Hello,
I'm having trouble to achieve the following: have an Internet client cliI reach srvB via gwA (and the routed VPN between vpnA and vpnB servers)
- WITHOUT using MASQUERADE of the client IP address
- WITHOUT routing lanB (_client_) Internet traffic through the VPN and gwA (but directly through gwB)
cliI (anyone) cliA cliA'
| | |
| | |
Internet (static IP) --- (eth0) gwA (br0) --- (lanA) --- (eth0) vpnA (server)
| (tun0)
| routed
| (tun11)
Internet (dynamic IP) ------------------------ (eth0) gwB/(lanB)/vpnB (client)
| (br0)
|
srvB
I'm aware I'll have to implement "exotic" routing on lanB to allow cliI traffic to be routed back from srvB through the VPN (I plan to do this with DSCP; iptables + ip route + ip rule).
Currently, I'm stuck at having the traffic of cliI go through the VPN:
On gwA: traffic is DNAT-ed to srvB
Chain PREROUTING (policy ACCEPT 2629 packets, 140K bytes)
25 1500 DNAT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:993 to:srvB
(NOTE: DNAT packets increases at each cliI connection attempt)
Chain FORWARD (policy DROP 0 packets, 0 bytes)
62 3720 ACCEPT tcp -- eth0 br0 0.0.0.0/0 srvB tcp dpt:993
(NOTE: ACCEPT packets increases at each cliI connection attempt)
11:04:42.643079 IP (tos 0x0, ttl 46, id 58984, offset 0, flags [DF], proto TCP (6), length 60)
cliI.35515 > gwA.993: Flags [S], cksum 0x98d5 (correct), seq 2335247159, win 29200, options [mss 1460,sackOK,TS val 838331743 ecr 0,nop,wscale 7], length 0
On vpnA: traffic is routed to tun0
Chain FORWARD (policy DROP 33 packets, 2772 bytes)
42593 7156K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
556 33456 ACCEPT all -- eth0 tun0 0.0.0.0/0 0.0.0.0/0
(NOTE: ACCEPT packets increases at each cliI connection attempt)
11:04:42.643191 IP (tos 0x0, ttl 45, id 58984, offset 0, flags [DF], proto TCP (6), length 60)
cliI.35515 > srvB.993: Flags [S], cksum 0x9669 (correct), seq 2335247159, win 29200, options [mss 1460,sackOK,TS val 838331743 ecr 0,nop,wscale 7], length 0
Feb 22 11:04:14 vpnA [...]: MULTI: Learn: srvB -> vpnB/gwB:58108
On vpnB: nothing shows up
Chain FORWARD (policy DROP 68 packets, 7235 bytes)
0 0 ACCEPT tcp -- tun11 * 0.0.0.0/0 srvB tcp dpt:993
(NOTE: DROP packets remain unchanged through cliI connection attempts)
Everything works like a charm for clients cliA and cliA'.
If I enable MASQUERADE-ing of cliI IP address, everythin works like a charm (but I really don't want to do that; I need to keep cliI IP address untouched for ACLs and logging)
From what I'm able to gather, it seems the incoming packet vanishes between vpnA and vpnB (and nothing relevant shows up in the logs).
Has anyone an idea what might happen and if OpenVPN requires some configuration setting for this scenario to work ?
Thanks and best,
Cédric