网络
最后更新于
# cat /etc/hostname.em0
inet 192.168.1.100 255.255.255.0 192.168.1.1# ifconfig em0 up# sh /etc/netstart em0inet 10.0.0.2 255.255.255.0
inet alias 10.0.0.3 255.255.255.255
inet alias 10.0.0.4 255.255.255.255# sh /etc/netstart re0inet 10.0.0.2 255.255.255.0
inet alias 192.168.100.10 255.255.255.0# ifconfig -A# echo "nwid mynetwork" > /etc/hostname.iwn0
# sh /etc/netstart iwn0# echo 'nwid mynetwork wpakey "mypassword"' > /etc/hostname.iwn0join mynetwork wpakey mypassword
dhcp# ifconfig iwn0 up
# ifconfig iwn0 scanmyhostname.example.netsearch example.net
nameserver 9.9.9.9
nameserver 2620:fe::fe# cat /etc/hosts
127.0.0.1 localhost
192.168.1.1 gw.example.net gw# chflags schg /etc/resolv.conf# netstat -rn
# netstat -rn -f inet6# route add default 192.168.1.1# route delete default!/sbin/route add -inet6 default 2001:db8::1# echo 'inet6 autoconf' > /etc/hostname.em0inet6 autoconfprivacyinet6 -autoconfinet6 2001:db8::100 64
!/sbin/route add -inet6 default 2001:db8::1# ping6 -c 3 openbsd.org
# traceroute6 openbsd.org# ping6 ff02::1%iwn0# cat /etc/hostname.bridge0
add em0
add em1
up# cat /etc/hostname.em0
up media 1000baseT mediaopt full-duplex
# cat /etc/hostname.em1
up media 1000baseT mediaopt full-duplex# cat /etc/hostname.trunk0
trunkproto lacp trunkport em0 trunkport em1
inet 192.168.1.2 255.255.255.0 192.168.1.1# ifconfig em0 media# ping 1.1.1.1
# ping openbsd.org# host openbsd.org# arp -a# traceroute openbsd.org# ifconfig iwn0# ifconfig iwn0 scan# ping6 ff02::1%iwn0# tcpdump -i em0# fw_update# cat /etc/pf.conf
set block-policy drop
block all
pass out all keep state
pass in on em0 proto tcp to port 22 keep state# rcctl enable pf
# pfctl -f /etc/pf.conf
# pfctl -e# tcpdump -n -e -ttt -i pflog0# cat /etc/hostname.vlan0
vnetid 10 parent em0
inet 192.168.10.100 255.255.255.0 192.168.10.1# rcctl enable unbound
# rcctl start unbound# ifconfig em0 mtu 9000# ifconfig em0 -tso