[root@B4-05-5D-54-21-D6 network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default homerouter.cpe 0.0.0.0 UG 107 0 0 enp26s0f0
default gateway 0.0.0.0 UG 108 0 0 enp26s0f1
10.42.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
169.254.169.250 0.0.0.0 255.255.255.255 UH 0 0 0 docker0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 0.0.0.0 255.255.255.0 U 108 0 0 enp26s0f1
192.168.8.0 0.0.0.0 255.255.255.0 U 107 0 0 enp26s0f0
[root@B4-05-5D-54-21-D6 network-scripts]# route add -net 192.168.8.0/24 gw 192.168.8.1 enp26s0f0 # 上外网
[root@B4-05-5D-54-21-D6 network-scripts]# route add -net 192.168.0.0/24 gw 192.168.0.1 enp26s0f1 # 上内网
[root@B4-05-5D-54-21-D6 network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default homerouter.cpe 0.0.0.0 UG 107 0 0 enp26s0f0
default gateway 0.0.0.0 UG 108 0 0 enp26s0f1
10.42.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
169.254.169.250 0.0.0.0 255.255.255.255 UH 0 0 0 docker0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 gateway 255.255.255.0 UG 0 0 0 enp26s0f1
192.168.0.0 0.0.0.0 255.255.255.0 U 108 0 0 enp26s0f1
192.168.8.0 homerouter.cpe 255.255.255.0 UG 0 0 0 enp26s0f0
192.168.8.0 0.0.0.0 255.255.255.0 U 107 0 0 enp26s0f0
[root@B4-05-5D-54-21-D6 network-scripts]# route add -net 10.72.83.0/24 gw 192.168.0.1 enp26s0f1 # 指定该网段走内网
[root@B4-05-5D-54-21-D6 network-scripts]# route add default gw 192.168.8.1 enp26s0f0 # 指定默认路由 网卡
[root@B4-05-5D-54-21-D6 network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default homerouter.cpe 0.0.0.0 UG 0 0 0 enp26s0f0
default homerouter.cpe 0.0.0.0 UG 107 0 0 enp26s0f0
default gateway 0.0.0.0 UG 108 0 0 enp26s0f1
10.42.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
10.72.83.0 gateway 255.255.255.0 UG 0 0 0 enp26s0f1
169.254.169.250 0.0.0.0 255.255.255.255 UH 0 0 0 docker0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 gateway 255.255.255.0 UG 0 0 0 enp26s0f1
192.168.0.0 0.0.0.0 255.255.255.0 U 108 0 0 enp26s0f1
192.168.8.0 homerouter.cpe 255.255.255.0 UG 0 0 0 enp26s0f0
192.168.8.0 0.0.0.0 255.255.255.0 U 107 0 0 enp26s0f0
[root@B4-05-5D-54-21-D6 network-scripts]# ping baidu.com
PING baidu.com (39.156.69.79) 56(84) bytes of data.
64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=1 ttl=47 time=74.9 ms
64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=2 ttl=47 time=84.7 ms
^C
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 74.914/79.821/84.728/4.907 ms
[root@B4-05-5D-54-21-D6 network-scripts]# ping 192.168.8.1
PING 192.168.8.1 (192.168.8.1) 56(84) bytes of data.
64 bytes from 192.168.8.1: icmp_seq=1 ttl=64 time=0.625 ms
64 bytes from 192.168.8.1: icmp_seq=2 ttl=64 time=0.674 ms
^C
2 packets transmitted, 2 received, 0% packet loss, time 1006ms
rtt min/avg/max/mdev = 0.625/0.649/0.674/0.035 ms
[root@B4-05-5D-54-21-D6 network-scripts]# ping 192.168.8.181
PING 192.168.8.181 (192.168.8.181) 56(84) bytes of data.
^C
1 packets transmitted, 0 received, 100% packet loss, time 0ms
[root@B4-05-5D-54-21-D6 network-scripts]# ping 192.168.8.104
PING 192.168.8.104 (192.168.8.104) 56(84) bytes of data.
^C
2 packets transmitted, 0 received, 100% packet loss, time 1043ms
[root@B4-05-5D-54-21-D6 network-scripts]# ping 192.168.8.103
PING 192.168.8.103 (192.168.8.103) 56(84) bytes of data.
64 bytes from 192.168.8.103: icmp_seq=1 ttl=64 time=0.067 ms
64 bytes from 192.168.8.103: icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from 192.168.8.103: icmp_seq=3 ttl=64 time=0.064 ms
^C
3 packets transmitted, 3 received, 0% packet loss, time 2078ms
rtt min/avg/max/mdev = 0.041/0.057/0.067/0.013 ms
[root@B4-05-5D-54-21-D6 network-scripts]# ping 192.168.8.101
PING 192.168.8.101 (192.168.8.101) 56(84) bytes of data.
^C
1 packets transmitted, 0 received, 100% packet loss, time 0ms
[root@B4-05-5D-54-21-D6 network-scripts]# ping 10.72.83.11
PING 10.72.83.11 (10.72.83.11) 56(84) bytes of data.
64 bytes from 10.72.83.11: icmp_seq=1 ttl=62 time=13.6 ms
64 bytes from 10.72.83.11: icmp_seq=2 ttl=62 time=22.1 ms
64 bytes from 10.72.83.11: icmp_seq=3 ttl=62 time=17.5 ms
64 bytes from 10.72.83.11: icmp_seq=4 ttl=62 time=11.7 ms
参考
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
2013-01-05 prependTo 移动元素内到最前段