网络命令备忘录 Linux/FreeBSD
网络 服务器
Published: 2021-01-29

常用的、常常忘记的个人网络命令备忘录。

查询

操作LinuxFreeBSD
确认接口ip link showifconfig -l
确认接口(包括地址)ip addrifconfig
确认接口的报文统计ip -s link dev netstat -idb -I
ARP表ip -4 neighborarp -a
IPv6邻居表ip -6 neighborndp -a

桥接

操作LinuxFreeBSD
添加接口brctl addif br0 eth0ifconfig bridge0 addm vtnet0
删除接口brctl delif br0 eth0ifconfig bridge0 deletem vtnet0
创建桥接接口brctl addbr br0 ip link set up dev br0ifconfig bridge0 create ifconfig bridge0 up
删除桥接接口ip link set down dev br0 brctl delbr br0ifconfig bridge0 down ifconfig bridge0 destroy

VLAN

操作LinuxFreeBSD
创建vlan接口ip link add link eth0 name eth0.10 type vlan id 10 ip link set up eth0.10ifconfig vtnet0.10 create ifconfig vtnet0.10 up
删除vlan接口ip link set down eth0.10 ip link delete dev eth0.10ifconfig vtnet0.10 down ifconfig vtnet0.10 destroy