Results 1 to 2 of 2

Thread: IPsec NAT and iptables

  1. #1
    Join Date
    Jan 2009
    Location
    Denmark
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    IPsec NAT and iptables

    Hi all

    I am fiddling around with two IPsec GW's in a test environment and ran into a issue.

    The issue i ran into is that my "local" IPsec GW is on 172.16.5.5/32, the "remote" IPsec GW is on 10.1.10.50

    On the "local" side i would like to NAT traffic from 192.168.1.0/24 through 172.16.5.5 and route this to 10.1.10.50/24.
    But i am not quite sure how to tell iptables to

    #1 NAT 192.168.1.0/24 network to 172.16.5.5/32
    #2 Route 172.16.5.5/32 traffic to 10.1.10.50/24

    Since it looks like that my iptables try to route the traffic from 192.168.1.0/24 directly to 10.1.10.50 around the tunnel.

    Hope someone can help me in the right direction since i haven't quite found how to do the above yet.

    Thanks on advance.
    Kind regards

  2. #2
    Join Date
    Feb 2014
    Beans
    142

    Re: IPsec NAT and iptables

    I'm no expert, but at least part of your solution might be in the route command
    Code:
    $ /sbin/route -n
    python -c 'print hex(3 << ((1024/4)-2))[:-1]'
    python -c 'print hex((1 << (1024/4))-1)[:-1]'

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
  •