我已经尝试了将近一周,但没有成功。我开始绝望了。
我有 4 个以太网适配器:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 30:85:a9:ad:54:1e brd ff:ff:ff:ff:ff:ff
inet 10.100.36.2/29 brd 10.100.36.7 scope global eth0
inet6 fe80::3285:a9ff:fead:541e/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether a0:f3:c1:04:64:40 brd ff:ff:ff:ff:ff:ff
inet 69.70.164.242/30 brd 69.70.164.243 scope global eth1
inet6 fe80::a2f3:c1ff:fe04:6440/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether a0:f3:c1:04:a0:2f brd ff:ff:ff:ff:ff:ff
inet 10.45.13.1/24 brd 10.45.13.255 scope global eth2
inet6 fe80::a2f3:c1ff:fe04:a02f/64 scope link
valid_lft forever preferred_lft forever
5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 28:10:7b:c9:58:76 brd ff:ff:ff:ff:ff:ff
inet 10.45.15.1/24 brd 10.45.15.255 scope global eth3
inet6 fe80::2a10:7bff:fec9:5876/64 scope link
valid_lft forever preferred_lft forever
这是我的 Linux 服务器(Debian)在启动时提供的默认路由:
69.70.164.240/30 dev eth1 proto kernel scope link src 69.70.164.242
10.100.36.0/29 dev eth0 proto kernel scope link src 10.100.36.2
10.45.15.0/24 dev eth3 proto kernel scope link src 10.45.15.1
10.45.13.0/24 dev eth2 proto kernel scope link src 10.45.13.1
default via 10.45.15.254 dev eth3
default via 10.45.13.254 dev eth2
default via 69.70.164.241 dev eth1
default via 10.100.36.1 dev eth0
以下是我想要做的。eth0 是我的 VDSL 线路,eth1 是我的电缆线路。我想要:
- 将所有流量从
10.45.13.0
(eth2)转发到网关10.100.36.1
(eth0) - 将所有流量从
10.45.15.0
(eth3)转发到网关69.70.164.241
(eth1)
如果我完成了这项工作,我会很高兴,但我还想让它变得10.45.13.0
看不见10.45.15.0
,反之亦然。
提前感谢您的帮助。
答案1
这里有一个清晰的解释和设置,请尝试一下: