Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    Link encap:Point-to-Point Protocol
    inet addr: P-t-P: Mask:

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

    Thanks for any suggestions

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    The Keystone State
    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.


    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