Find the answer to your Linux question:
Results 1 to 2 of 2
Hi and sorry for double post, I'm trying to configure iptables to route all traffic for my pptpd vpn connection via a certain netlink ( eth0:8 ) to have a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2

    Iptables VPN advice required


    Hi and sorry for double post,

    I'm trying to configure iptables to route all traffic for my pptpd vpn connection via a certain netlink ( eth0:8 ) to have a specific single outgoing IP address and to use the vpn's dns servers.

    I have this line which somehow works, but it's routing through the first system IP
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    Also Squid is configured to use several outgoing IP addresses, but it always goes out with the first system IP once the above iptables line is active

    The pppd link when the connection is established (IP range 10.5.1.100-10.5.1.105):
    ppp0
    Link encap:Point-to-Point Protocol
    inet addr:10.5.1.3 P-t-P:10.5.1.100 Mask:255.255.255.255

    The outgoing link I'd like to use for vpn
    eth0:8
    Link encap:Ethernet HWaddr 00:24:8c:a6:5a:8d
    inet addr:123.123.123.123 Bcast:234.234.234.234 Mask:255.255.255.0

    Thanks for any suggestions

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    IPTABLES does not do sub-interfaces which eth0:8 is. Everything will get the ip address of eth0.
    If you want a range to get an ip address then you are going to have to setup SNAT and DNAT.
    Information on doing this can be found HERE.

    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
  •