GOAL: Access internal network devices and browse web via the tunnel.
192.168.2.x = internal network
192.168.3.x = openvpn server
192.168.2.111 = openvpn server on internal network
[root@openvpn ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.2 * 255.255.255.255 UH 0 0 0 tun0
192.168.3.0 192.168.3.2 255.255.255.0 UG 0 0 0 tun0
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 192.168.2.254 0.0.0.0 UG 0 0 0 eth0
and
[root@openvpn ~]# cat /etc/openvpn/server.conf
port 1194 #- port
proto udp #- protocol
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
reneg-sec 0
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login #- Comment this line if you are using FreeRADIUS
#plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf #- Uncomment this line if you are using FreeRADIUS
client-cert-not-required
username-as-common-name
server 192.168.3.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "route 192.168.2.0 255.255.255.0"
keepalive 5 30
comp-lzo
persist-key
persist-tun
status 1194.log
verb 3
and
client
dev tun
proto udp
remote 18.4.79.28 1194
resolv-retry infinite
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ca ca.crt
auth-user-pass
comp-lzo
reneg-sec 0
verb 3
I can connect just fine and access the VPN box. However, I can not browse the web or access other local network devices.
I have IPTables off. Do I need IP table rules or is my routing off?
I need 192.168.3.0 to access 192.168.2.0 :)
EDIT: forgot to mention, I do have this set;
net.ipv4.conf.default.forwarding=1
EDIT:
I used this:
[root@openvpn ~]# iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source <SERVERIP>
[root@openvpn ~]# iptables -I INPUT 1 -p udp --dport 1194 -j ACCEPT
I GET:
pinging 192.168.2.5
reply from 192.168.3.1 destination host unreachable