Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: 2 default route with VPN

  1. #11
    Join Date
    Oct 2011
    Beans
    47

    Re: 2 default route with VPN

    I think I found what I Need at this link.
    But i dont know if my VPN Network IP will always be the same. so maybe i can script something.

    http://kindlund.wordpress.com/2007/1...utes-in-linux/

  2. #12
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,699

    Re: 2 default route with VPN

    OK, Got it. This works - I verified with tcpdump that I can change the next-hop MAC address the packets are sent to:
    Code:
    # Make a new routing table with a different default route
    ip route add default via 192.168.0.1 table 42
     
    # Mark packets that need special routing
    iptables -t mangle -A OUTPUT -p tcp --dport 22 -j MARK --set-mark 99
     
    # Add a rule to use a different routing table for marked packets
    ip rule add fwmark 99 table 42
    P.S. Here's a good referemce: http://lartc.org/
    Last edited by The Cog; December 11th, 2012 at 07:59 PM. Reason: P.S.

  3. #13
    Join Date
    Oct 2011
    Beans
    47

    Re: 2 default route with VPN

    Quote Originally Posted by The Cog View Post
    OK, Got it. This works - I verified with tcpdump that I can change the next-hop MAC address the packets are sent to:
    Code:
    # Make a new routing table with a different default route
    ip route add default via 192.168.0.1 table 42
     
    # Mark packets that need special routing
    iptables -t mangle -A OUTPUT -p tcp --dport 22 -j MARK --set-mark 99
     
    # Add a rule to use a different routing table for marked packets
    ip rule add fwmark 99 table 42
    Awesome! Thank you for verifying Cog.
    I will try this as soon as im at home!
    Last edited by Catalyph; December 11th, 2012 at 07:55 PM. Reason: typo

  4. #14
    Join Date
    Oct 2011
    Beans
    47

    Re: 2 default route with VPN

    neither one of these worked.

    The ppp0 vpn connection is still blocking the ssh connection..

  5. #15
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,699

    Re: 2 default route with VPN

    There must be something else going on. Can you run
    sudo tcpdump -eni any tcp port 22
    while you try to connect the SSH, voth with and without the VPN running, and post the output?

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

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