I'm trying to make my client forward all traffic through a VPS running OpenVPN. As you can see, it will allow pings to both domains and raw IP addresses, but it will not allow traffic like that made through curl and traceroute doesn't come up with anything. The traffic works correctly when not connected to the VPN. Please help, thanks.
Info:
Client output:
root@Kali:~/Downloads# openvpn --config client.conf
Sun Nov 30 11:59:40 2014 OpenVPN 2.2.1 i486-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Jun 19 2013
Sun Nov 30 11:59:40 2014 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sun Nov 30 11:59:40 2014 WARNING: file 'vpnclient1.key' is group or others accessible
Sun Nov 30 11:59:40 2014 LZO compression initialized
Sun Nov 30 11:59:40 2014 Control Channel MTU parms [ L:1558 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Nov 30 11:59:40 2014 Socket Buffers: R=[163840->131072] S=[163840->131072]
Sun Nov 30 11:59:40 2014 Data Channel MTU parms [ L:1558 D:1450 EF:58 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Nov 30 11:59:40 2014 Local Options hash (VER=V4): '22188c5b'
Sun Nov 30 11:59:40 2014 Expected Remote Options hash (VER=V4): 'a8f55717'
Sun Nov 30 11:59:40 2014 UDPv4 link local: [undef]
Sun Nov 30 11:59:40 2014 UDPv4 link remote: [AF_INET]x.x.x.x:61098
Sun Nov 30 11:59:40 2014 TLS: Initial packet from [AF_INET]x.x.x.x:61098, sid=ec2af233 4431930c
Sun Nov 30 11:59:41 2014 VERIFY OK: depth=1, /C=US/ST=MD/L=Fort_Meade/O=National_Security_Agency/OU=Tailored_Access_Operations/CN=National_Security_Agency_CA/name=NSA/emailAddress=tao@nsa.gov
Sun Nov 30 11:59:41 2014 VERIFY OK: nsCertType=SERVER
Sun Nov 30 11:59:41 2014 VERIFY OK: depth=0, /C=US/ST=MD/L=Fort_Meade/O=National_Security_Agency/OU=Tailored_Access_Operations/CN=NSA_VPN_Access/name=NSA/emailAddress=tao@nsa.gov
Sun Nov 30 11:59:43 2014 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Sun Nov 30 11:59:43 2014 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Nov 30 11:59:43 2014 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Sun Nov 30 11:59:43 2014 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Nov 30 11:59:43 2014 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 4096 bit RSA
Sun Nov 30 11:59:43 2014 [NSA_VPN_Access] Peer Connection Initiated with [AF_INET]x.x.x.x:61098
Sun Nov 30 11:59:46 2014 SENT CONTROL [NSA_VPN_Access]: 'PUSH_REQUEST' (status=1)
Sun Nov 30 11:59:46 2014 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
Sun Nov 30 11:59:46 2014 OPTIONS IMPORT: timers and/or timeouts modified
Sun Nov 30 11:59:46 2014 OPTIONS IMPORT: --ifconfig/up options modified
Sun Nov 30 11:59:46 2014 OPTIONS IMPORT: route options modified
Sun Nov 30 11:59:46 2014 ROUTE default_gateway=192.168.2.1
Sun Nov 30 11:59:46 2014 TUN/TAP device tun0 opened
Sun Nov 30 11:59:46 2014 TUN/TAP TX queue length set to 100
Sun Nov 30 11:59:46 2014 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Nov 30 11:59:46 2014 /sbin/ifconfig tun0 10.8.0.6 pointopoint 10.8.0.5 mtu 1500
Sun Nov 30 11:59:46 2014 /sbin/route add -net x.x.x.x netmask 255.255.255.255 gw 192.168.2.1
Sun Nov 30 11:59:46 2014 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.8.0.5
Sun Nov 30 11:59:46 2014 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.8.0.5
Sun Nov 30 11:59:46 2014 /sbin/route add -net 10.8.0.1 netmask 255.255.255.255 gw 10.8.0.5
Sun Nov 30 11:59:46 2014 Initialization Sequence Completed
Client config:
root@Kali:~/Downloads# cat client.conf
client
dev tun
proto udp
remote x.x.x.x 61098
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert vpnclient1.crt
key vpnclient1.key
ns-cert-type server
cipher AES-256-CBC
comp-lzo
verb 3
Client interfaces and routes:
root@Kali:~/Downloads# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:d6:e5:53
inet addr:192.168.2.100 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:730579 errors:0 dropped:0 overruns:0 frame:0
TX packets:840542 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:948096029 (904.1 MiB) TX bytes:244217840 (232.9 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:733355 errors:0 dropped:0 overruns:0 frame:0
TX packets:733355 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:54276427 (51.7 MiB) TX bytes:54276427 (51.7 MiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.6 P-t-P:10.8.0.5 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1200 (1.1 KiB) TX bytes:10710 (10.4 KiB)
root@Kali:~/Downloads# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0
10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.8.0.5 128.0.0.0 UG 0 0 0 tun0
x.x.x.x 192.168.2.1 255.255.255.255 UGH 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Server routes and interfaces:
root@MainServer:/etc/openvpn# cat /proc/sys/net/ipv4/ip_forward
1
root@MainServer:/etc/openvpn# iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
root@MainServer:/etc/openvpn# ifconfig
eth0 Link encap:Ethernet HWaddr 04:01:28:ce:fd:01
inet addr:x.x.x.x Bcast:162.243.150.255 Mask:255.255.255.0
inet6 addr: fe80::601:28ff:fece:fd01/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15420801 errors:0 dropped:0 overruns:0 frame:0
TX packets:13965057 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16312837213 (16.3 GB) TX bytes:17273432904 (17.2 GB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:6808 errors:0 dropped:0 overruns:0 frame:0
TX packets:6808 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2158598 (2.1 MB) TX bytes:2158598 (2.1 MB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:213 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:13116 (13.1 KB) TX bytes:1968 (1.9 KB)
root@MainServer:/etc/openvpn# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 162.243.150.1 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
162.243.150.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Server config:
root@MainServer:/etc/openvpn# cat server.conf
port 61098
proto udp
dev tun
ca ca.crt
cert vpnserver.crt
key vpnserver.key # This file should be kept secret
dh dh4096.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3