hoopycat wrote:
Right now, you've got two machines involved at the endpoint: your workstation (192.168.1.101) and your VPN gateway (192.168.2.2). If you connect straight from your workstation (or laptop, or whatever), your traffic should be originating from 192.168.2.0/24 or whatever the OpenVPN stuff is assigning.
192.168.2.2 is the address my laptop gets from the VPN. The VPN server (aka my linode) is 192.168.2.1.
hoopycat wrote:
How about on the eth0 side? Do you see it as 192.168.1.101 or something else?
Since you asked
Code:
$ sudo tcpdump -i eth0 -n | grep 74.125.45.100
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
20:47:18.039794 IP 209.123.162.201.50604 > 74.125.45.100.80: S 1187533034:1187533034(0) win 5840 <mss 1334,sackOK,timestamp 13374642 0,nop,wscale 6>
20:47:18.074996 IP 74.125.45.100.80 > 209.123.162.201.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990835218 13374642,nop,wscale 6>
20:47:18.075020 IP 74.125.45.100.80 > 192.168.1.100.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990835218 13374642,nop,wscale 6>
20:47:18.483612 IP 74.125.45.100.80 > 209.123.162.201.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990835627 13374642,nop,wscale 6>
20:47:18.483636 IP 74.125.45.100.80 > 192.168.1.100.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990835627 13374642,nop,wscale 6>
20:47:19.084976 IP 74.125.45.100.80 > 209.123.162.201.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990836228 13374642,nop,wscale 6>
20:47:19.085019 IP 74.125.45.100.80 > 192.168.1.100.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990836228 13374642,nop,wscale 6>
20:47:20.284925 IP 74.125.45.100.80 > 209.123.162.201.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990837428 13374642,nop,wscale 6>
20:47:20.284994 IP 74.125.45.100.80 > 192.168.1.100.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990837428 13374642,nop,wscale 6>
20:47:20.867654 IP 209.123.162.201.50604 > 74.125.45.100.80: S 1187533034:1187533034(0) win 5840 <mss 1334,sackOK,timestamp 13375392 0,nop,wscale 6>
20:47:20.891638 IP 74.125.45.100.80 > 209.123.162.201.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990838035 13374642,nop,wscale 6>
20:47:20.891663 IP 74.125.45.100.80 > 192.168.1.100.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990838035 13374642,nop,wscale 6>
20:47:21.884928 IP 74.125.45.100.80 > 209.123.162.201.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990839028 13374642,nop,wscale 6>
20:47:21.884955 IP 74.125.45.100.80 > 192.168.1.100.50604: S 514506911:514506911(0) ack 1187533035 win 5672 <mss 1430,sackOK,timestamp 1990839028 13374642,nop,wscale 6>
$ sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 181K packets, 9535K bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 1157K packets, 74M bytes)
pkts bytes target prot opt in out source destination
3 180 MASQUERADE all -- any eth0 192.168.1.0/24 anywhere
Chain OUTPUT (policy ACCEPT 1157K packets, 74M bytes)
pkts bytes target prot opt in out source destination
It may not be obvious at first from the logs, but the traffic here was in bursts (retries?). I'm really leaning towards a problem with the return traffic, but I don't know what else needs to be set up to have it re-masquerade back. I'm also not sure if I should double NAT it... what do you think?
I've also used SOCKS5 proxies (or just an SSH tunnel to 3128): my goal here is to set up a PC to always use a transparent squid proxy (to prevent direct access to the internet).