source ip address of all traffic via openvpn tunnel

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
creagel
OpenVpn Newbie
Posts: 2
Joined: Sat Feb 19, 2011 2:03 pm

source ip address of all traffic via openvpn tunnel

Post by creagel » Sat Feb 19, 2011 2:13 pm

Hi,

I have routed ptp tunnel (openvpn 2.1, tun interfaces). Everything works fine. But any traffic going via this tunnel have source ip address of one of the point of openvpn tunnel. It's possible to have unchanged source ip address of traffic via this tunnel?

Topology:

[LAN1]--------[VPN_BOX1]------------{internet}----------[VPN_BOX2]-----------[LAN2]

VPN_BOX1:
eth0: 192.168.1.1/24
tun0: 10.90.0.1

VPN_BOX2:
eth0: 192.168.2.1/24
tun0: 10.90.0.2


If I ping from PC in LAN1 any PC in LAN2, and on PC in LAN2 run tcpdump, then I get any packets have source ip addres 10.90.0.1.

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: source ip address of all traffic via openvpn tunnel

Post by maikcat » Sun Feb 20, 2011 11:08 am

hi there,

what OS has vpn-box1?

if linux try posting here what iptables -L -t nat returns..


cheers,

michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

creagel
OpenVpn Newbie
Posts: 2
Joined: Sat Feb 19, 2011 2:03 pm

Re: source ip address of all traffic via openvpn tunnel

Post by creagel » Sun Feb 20, 2011 9:13 pm

It's freebsd 7. I don't use any firewall or nat.

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: source ip address of all traffic via openvpn tunnel

Post by janjust » Mon Feb 21, 2011 7:30 am

openvpn does not do NAT'ting by itself, unless the freebsd port is totally broken. Your VPN Boxen are doing NAT'ting somewhere, check the configurations.
Also, try running tcpdump on one of the VPN boxen to follow the flow of packets - which source IP do the packets have when they enter the VPN box?

Post Reply