Linux 篇:
ipv4:
#添加到主机的路由
route add --host 192.168.168.110 dev eth0
route add --host 192.168.168.119 gw 192.168.168.1
#添加到网络的路由
route add --net IP netmask MASK eth0
route add --net IP netmask MASK gw IP
route add --net IP/24 eth1
#添加默认网关
route add default gw IP
#删除路由
route del --host 192.168.168.110 dev eth0
ipv6:
ip -6 route add IPV6地址/掩码 via 网关地址 dev 网卡名称
ip -6 route add 2001:db8:0:1::100/64 dev eth0.2
ip route add 2001:db8:0:1::100/64 dev eth0.2
p route add IPV地址/掩码 via 网关地址 dev 网卡名称
route add default dev eth0
删除默认路由:
route del default dev eth0
ip route add default via 192.168.1.1(网关地址) dev eth0
ip route del default via 192.168.0.1 dev eth0
ip -6 route del default via fe80::2858:63ff:fe5c:daa7 dev eth0
ip -6 route del default
删除ipaddress
ip addr del ip地址 dev 接口
ip addr flush dev 接口
windows:
route add 192.168.20.10 mask 255.255.255.0 192.168.20.1(gw)
删除路由:
route delete 192.168.20.10