C
C
cyberorg2013-05-16 21:15:26
linux
cyberorg, 2013-05-16 21:15:26

Routing with two links from one provider

Initially, it was like this: The

provider allocated two links in the same network.
Each of the links went directly to its own server.

Decided to put the gateway before these servers.
Now the cables that went to the servers are plugged into eth0 and eth1 of the gateway.

It turned out like this:


Task and questions:
Everything that goes to ip 101.1.1.22 to a server on the 192.168.18.0.30 network (which is directly connected to eth3 on the gateway (192.168.18.1)).
Reverse also release from the address 101.1.1.22 (eth0) Release

everything else through eth1 - 101.1.1.23 (default gateway).

How to do this with iptables and routing on GNU/Debian Linux?
Well, or at least what words to google?

UPD: The problem is aggravated by the fact that eth0 can easily receive traffic from dst 101.1.1.23, and eth1 from dst 101.1.1.22. Because of ARP.
Here is a description of this problem (this is also my question): habrahabr.ru/qa/40187/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Petrikov, 2013-05-17
@RicoX

Do something like this:

ip route add default via 101.1.1.22 table 22
ip route add default via 101.1.1.23 table 23
ip rule add from 192.168.18.0/30 table 22
ip rule add from 192.168.8.0/24 table 23

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question