Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

How to use IP tables to route ports through / around a VPN connection

  • 29-11-2014 08:16PM
    #1
    Registered Users, Registered Users 2 Posts: 390 ✭✭


    Hi All,

    I'm using a Netgear R6300 running DD-WRT v24-sp2 (10/27/14) giga - build build r24170.

    I have a running VPN connection to a 3rd party VPN supplier. I have specific IP addresses that I route through the VPN, but what I would like to do in conjunction, is route particular ports through the VPN, and other ports directly to my ISP. I understand that I need to use IPtables to do this, but I cannot for the life of me get my head around it.

    For example port 80 should go direct to my ISP, but port 500 should go through the VPN.

    Can anyone provide an example of how I might go about this? I have searched many sites, but cannot find / understand one that will work.

    Thanks in advance,

    SH


Comments

  • Registered Users, Registered Users 2 Posts: 1,193 ✭✭✭liamo


    This thread at linuxquestions.org asks much the same question.

    From the article :
    Basically, you edit your firewall rules to mark stuff from a specific port (ssh or icq, whatever) with a number. Then you configure iproute to send everything marked with that number out the correct interface.

    It also helpfully points you to the Advanced Routing HowTo

    Hope this helps

    Liam


Advertisement