Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

VPN outgoing traffic; select eth

I have a server that use StrongSwan as VPN server. I have two IPs. How do I select which IP to use as out going traffic?
Thanks

Comments

  • Was OS is it running? Easiest way is to have only one gateway. I have some servers that have a VPN connected and I don't want regular internet traffic going through the VPN. So for the VPN's interface I don't put a gateway.

  • iptables and then you can choose the output interface or you can use SNAT with --to-source

  • It is Ubuntu 14. I have two IPs/eth. I want VPN user to connect to IP1. However, I want their outgoing traffic(visiting other website through VPN) using 2nd IP.

  • How to modify this Iptables to define the outgoing eth?
    iptables --table nat --append POSTROUTING --jump MASQUERADE

  • howardsl2howardsl2 Member
    edited December 2015

    @dnwk said:

    iptables -t nat -A POSTROUTING -s VPN_SUBNET_CIDR -o eth+ -j SNAT --to-source VPN_SERVER_2nd_IP

    Also in /etc/ipsec.conf, try adding this line: leftnexthop=Gateway_of_2nd_IP

    Thanked by 1dnwk
Sign In or Register to comment.