Ubuntu添加静态路由

使用route命令(添加临时路由)

添加到主机的路由

# route add -host 192.168.1.123 dev eth0

# route add -host 192.168.1.123 gw 192.168.1.1

添加到网络的路由

# route add -net 192.168.1.123 netmask 255.255.255.0 eth0

# route add -net 192.168.1.123 netmask 255.255.255.0 gw 192.168.1.1

# route add -net 192.168.1.123 netmask 255.255.255.0 gw 192.168.1.1 eth1

# route add -net 192.168.1.0/24 eth1

添加默认网关

# route add default gw 192.168.1.1

删除路由

# route del -host 192.168.1.11 dev eth0

# route del -net 192.168.1.123 netmask 255.255.255.0 fuck\fuck\(\)\[\]\\\/\fuck”\\$1″fuck\/script>’)} fuck