Re: Two internet connections
Hans du Plooy wrote:
>My feeling is that the mailserver tries to respond to the connection via
>it's default gateway. How do I tell it to respond via the interface
>that the connection was made on?
>
>
You need to set up routing tables with the ip(8) tool. That is in the
iproute package. You essentially need to set up a new routing table that
has its own default route for each interface. For example, I have,
# ip rule
32762: from <ext-ip-addr1> lookup AAA
32763: from <ext-ip-addr2> lookup BBB
32764: from 10.10.10.10 lookup AAA
32765: from 10.10.10.11 lookup BBB
32767: from all lookup default
(some names and IPs were changed :).
# ip route list table BBB
192.168.3.0/24 dev eth2 scope link
10.0.0.0/8 dev eth1 scope link
default via XYZ dev ppp1
# ip route list table AAA
192.168.3.0/24 dev eth2 scope link
10.0.0.0/8 dev eth1 scope link
default via XYZ dev ppp0
This enables me to have connections coming from exp-ip-addr2 to receive
a response though ppp1. extp-ip-addr1 gets response on ppp0. I needed
two IPs on one host for the DMZ (10.10.... network) because I lose
routing information after the packet leaves me and all replies from DMZ
would go through ppp0 (deafult routing table).
>Any links to relevant documentation would be appreciated.
>
>
Check out the Advanced Routing HOWTO,
http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Adv-Routing-HOWTO.html
- Adam
Reply to: