1.route//如果Gateway处显示bogon是因为IP地址为私网地址,可以加-n参数➜~route-nKernelIProutingtableDestination
1.route //如果Gateway处显示bogon是因为IP地址为私网地址,可以加 -n参数
➜ ~ route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 192.168.3.1 0.0.0.0 UG 600 0 0 wlp7s0link-local 0.0.0.0 255.255.0.0 U 1000 0 0 virbr0172.16.90.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8192.168.3.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp7s0192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
2.ip route show
➜ ~ ip route show default via 192.168.3.1 dev wlp7s0 proto dhcp metric 600 169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown 172.16.90.0/24 dev vmnet8 proto kernel scope link src 172.16.90.1 192.168.3.0/24 dev wlp7s0 proto kernel scope link src 192.168.3.23 metric 600 192.168.4.0/24 dev vmnet1 proto kernel scope link src 192.168.4.1 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
3.netstat -rn
➜ ~ netstat -rn Kernel IP routing tableDestination Gateway Genmask Flags MSS Window irtt Iface0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 wlp7s0169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 virbr0172.16.90.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp7s0192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
4.添加自定义路由条目
➜ ~ route add -net 10.0.29.0 netmask 255.255.255.0 gw 192.168.0.183
本文内容由互联网用户自发贡献,该文观点仅代表作者本人,本站仅供展示。如发现本站有涉嫌抄袭侵权/违法违规的内容,请发送邮件至 97552693@qq.com 举报,一经查实,本站将立刻删除。