赞
踩
目录
route print
- route add -p $目标网段 mask $netmask $gateway
-
- route add -p $目标网段 mask $netmask $gateway
- #添加默认路由,metric为优先级(值越大,优先级越低)
- route add -p 0.0.0.0 mask 0.0.0.0 $gateway metric 10
- #删除路由规则
- route delete $目标网段 mask $netmask
- ip route show
- 或
- route -n
- ip route add [destination] via [gateway] dev [interface]
- 或
- route add -net [network_address] netmask [netmask] gw [gateway_ip] dev [interface]
-
- # 示例
- ip route add 192.168.2.0/24 via 192.168.1.1 dev eth0
- # 删除路由
- ip route del [destination]
- 或
- route del -net [network_address] netmask [netmask] gw [gateway_ip]
-
- # 示例
- ip route del 192.168.2.0/24
- # 修改路由
- ip route change [destination] via [new_gateway] dev [interface]
- # 临时路由(直到重启或清除)
- ip route add [destination] via [gateway] dev [interface] temporary
- # 默认网关设置
- ip route add default via [gateway_ip] dev [interface]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。