Hello everyone! 😃
I know this subject has been beat to death, but my ip address does not change when I connect to the OpenVPN server. I googled around the web/openvpn forum and almost every thread says to add this line to the server.conf file,
"push "redirect-gateway def1 bypass-dhcp." When I add the redirect gateway line to the server config file, the server will connect, but it will have no internet connectivity and the VPN disconnects within a few minutes. It seems like the documentation is a little thin in this area. :cry:
Any help would be greatly appreciated! My client/sever configs and iptables rule set is as follows:
**Server.conf**
local 10.1.10.82
port 1194
proto udp
dev tun
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/dh2048.pem
tls-auth /etc/openvpn/easy-rsa/2.0/keys/ta.key 0 # This file should be kept secret
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.1.10.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
log-append /var/log/openvpn.log
verb3
**Client config / .tblk file**
client
dev tun
proto udp
remote ip_address 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert ben.crt
key ben.key
ns-cert-type server
tls-auth ta.key 1
comp-lzo
verb 3
cipher AES-256-CBC
**IP Tables Rules**
[root@ygritte openvpn]# iptables -L -v -n --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT udp -- * * 10.1.10.0/24 0.0.0.0/0 udp dpt:53
2 0 0 ACCEPT tcp -- * * 10.1.10.0/24 0.0.0.0/0 tcp dpt:53
3 0 0 ACCEPT tcp -- * * 10.8.0.0/24 0.0.0.0/0 tcp dpt:53
4 0 0 ACCEPT udp -- * * 10.8.0.0/24 0.0.0.0/0 udp dpt:53
5 13405 1711K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
6 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
7 35 2565 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
8 750 41020 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
9 0 0 ACCEPT all -- tun+ * 0.0.0.0/0 0.0.0.0/0
10 0 0 ACCEPT all -- tap+ * 0.0.0.0/0 0.0.0.0/0
11 2 140 ACCEPT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:1194
12 72005 12M REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT all -- * * 10.8.0.0/24 0.0.0.0/0
2 0 0 ACCEPT all -- tun+ * 0.0.0.0/0 0.0.0.0/0
3 0 0 ACCEPT all -- tap+ * 0.0.0.0/0 0.0.0.0/0
4 0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
5 0 0 ACCEPT all -- tun0 * 0.0.0.0/0 0.0.0.0/0
6 0 0 ACCEPT all -- tun0 eth0 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
Chain OUTPUT (policy ACCEPT 17315 packets, 2883K bytes)
num pkts bytes target prot opt in out source destination
[root@ygritte openvpn]# iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 72699 packets, 12M bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 27 packets, 1965 bytes)
pkts bytes target prot opt in out source destination
1873 145K MASQUERADE all -- * eth0 0.0.0.0/0 0.0.0.0/0
0 0 MASQUERADE all -- * eth0 10.8.0.0/24 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 1900 packets, 147K bytes)
pkts bytes target prot opt in out source destination