[Help!] OpenVPN NAT issue

Discussion in 'Server Operation' started by josesan311, May 30, 2008.

  1. josesan311

    josesan311 New Member

    Hello guys,

    Thank you for reading this post.
    Im dealing with some OpenVPN issue, im trying to setup my desktop connection (winxp) to my linux server connection.
    My server has 3 ip address.
    OpenVPN is currently letting me go outside an browse with my server main outgoing ip, but the reason for this post if that im unable to make NAT to use my 2nd outgoing ip for browsing, i ran the NAT rules but im still browsing with the main ip.

    Here is my NAT table

    Code:
    SNAT       all  --  10.1.0.1             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.2             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.3             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.4             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.5             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.6             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.7             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.8             anywhere            to:XXX.XXX.XXX.220
    SNAT       all  --  10.1.0.9             anywhere            to:XXX.XXX.XXX.220
    My openvpn private ip on my winxp desktop is 10.1.0.6

    This is my actual route table:
    Code:
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    10.1.0.2        *               255.255.255.255 UH    0      0        0 tun0
    10.1.0.0        10.1.0.2        255.255.255.0   UG    0      0        0 tun0
    XXX.XXX.XXX.0    *               255.255.240.0   U     0      0        0 eth0
    169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
    default         XXX.XXX.XXX.1    0.0.0.0         UG    0      0        0 eth0
    
    This is my server.conf
    Code:
    port 1194
    proto tcp
    dev tun
    ca keys/ca.crt
    cert keys/server.crt
    key keys/server.key    # This file should be kept secret
    dh keys/dh1024.pem
    client-to-client                    # To allow clients to see each other
    server 10.1.0.0 255.255.255.0       # Set to virtual network and subnet mask
    ifconfig-pool-persist 0 ipp.txt
    push "dhcp-option DNS XXX.XXX.XXX"
    push "dhcp-option DNS XXX:XXX:XXX"
    #push "redirect-gateway def1"
    keepalive 10 120
    cipher AES-128-CBC   # AES
    comp-lzo
    persist-key
    persist-tun
    user nobody
    group nobody
    status openvpn-status.log
    verb 3
    This is my client.ovpn
    Code:
    client
    dev tun
    proto tcp
    remote XXX.XXX.XXX.220 1194  # use real name or IP address of the server
    resolv-retry infinite
    nobind
    ns-cert-type server
    tls-client 
    persist-key
    persist-tun
    ca "C:\\Archivos de programa\\OpenVPN\\config\\ca.crt"
    cert "C:\\Archivos de programa\\OpenVPN\\config\\cuarto.crt"
    key "C:\\Archivos de programa\\OpenVPN\\config\\cuarto.key"
    cipher AES-128-CBC   # AES
    comp-lzo
    verb 3

    I hope you can help me.

    Thank you in advance!
     
    Last edited: May 30, 2008

Share This Page