小编Fre*_*iek的帖子

通过特定网络接口路由特定 ip 的所有流量

我有一个需要获得一些路由的 linux 服务器。我对此很陌生,我在谷歌上找不到任何明确的来源。

设置应该很简单:
所有到 ip 192.168.72.20 上的服务器的流量都应该通过接口 3 发送。所有其他接口目前都无关紧要。

在这里你有输出 route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.72.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.72.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.72.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.72.0    0.0.0.0         255.255.255.0   U     0      0        0 eth3
192.168.72.0    0.0.0.0         255.255.255.0   U     0      0        0 eth4
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         192.168.72.12   0.0.0.0         UG    0      0        0 …
Run Code Online (Sandbox Code Playgroud)

networking linux routing

23
推荐指数
1
解决办法
7万
查看次数

标签 统计

linux ×1

networking ×1

routing ×1