Find the answer to your Linux question:
Results 1 to 2 of 2
In the past I got this to work, but on a new server I just built I cannot. I have two networks set up on one interface. eth4 is 192.168.0.1 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5

    need help with iproute2 and multiple NATs


    In the past I got this to work, but on a new server I just built I cannot.

    I have two networks set up on one interface.

    eth4 is 192.168.0.1
    eth4:0 is 192.168.1.1

    I have two outgoing connections - eth3 is my cable modem, and ppp0 is a PPTP VPN.

    I want workstations in the 192.168.0.0/24 network to use the cable modem, and workstations in the 192.168.1.0/24 network to use the VPN.

    On my other server, I was using iproute2:
    ifconfig eth4:0 192.168.1.1 netmask 255.255.255.0
    ip route flush table 18
    ip route add table 18 to 192.168.1.0/24 dev eth4:0
    ip rule add from 192.168.1.0/24 table 18 priority 18
    ip route flush cache
    ip route add table 18 to default via $PPP_REMOTE dev ppp0

    via iptables I masquerade traffic from 192.168.1.0/24 to ppp0:
    iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j MASQUERADE

    my 192.168.0.0/24 network is working fine. It's simply masqueraded in the same manner over eth3. traffic from 192.168.1.13 is not getting out, and I'm not sure what I'm missing here. like I said, masquerading/NAT works fine on this system, as 192.168.0.3 can get out to the internet without issue.

    As you can see, I have three other ethernet interfaces in this box, so I could just move 192.168.1.1 to one of those and plug it into my switch and try that. And I might. But I am perplexed here, because this exact setup worked as I expected on my old server.

    I'd been thinking of using multiple (physical) ethernet interfaces anyway, to increase the bandwidth from the server to the LAN. any advice here is appreciated. I enjoy system administration, but am an amateur, and I know it.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Show the output from the following commands;

    Code:
    route -n
    ifconfig

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •