After a reboot if I run curl
http://www.icanhazip.com it seems like the first 2 or so return my real ip address, the next batch will return my vpn ip. I have some traffic I'd like to keep private , to be safe I was routing all traffic from a particular server through the vpn. If I delete the default route ("route del default") everything mostly works (the ones that would reveal my ip fail, the others work). I've tried setting the gateway in the ifcfg-eth file with no positive impact. Looking for some advice or direction on where I should be looking to resolve this. I'd like to have all traffic for this server go through the vpn all the time (and fail if the vpn isn't available). Not sure if I should be looking at firewall/openvpn config/ network config/ ?.
Thanks
openvpn server.conf:
client
dev tun
proto tcp
remote 162.253.129.98 443
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass /etc/openvpn/.pia
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.pem
log /var/log/ovpn-client.log
cat resolv.conf
# Generated by NetworkManager
nameserver 209.222.18.222
nameserver 209.222.18.218
[root@nas help]# cat ifcfg-enp3s0
BOOTPROTO="static"
DNS1=209.222.18.222
DNS2=209.222.18.218
GATEWAY=192.168.1.1
#GATEWAY=10.30.1.5
HWADDR=xxx
IPADDR=192.168.1.10
#IPV4_FAILURE_FATAL="no"
NAME="enp3s0"
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT="yes"
TYPE="Ethernet"
UUID=xxx
[root@nas help]# cat route-n.atboot.txt
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 1024 0 0 enp3s0
10.30.1.1 10.30.1.5 255.255.255.255 UGH 20 0 0 tun0
10.30.1.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.30.1.5 128.0.0.0 UG 20 0 0 tun0
162.253.129.98 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0
This mostly works:
[root@nas help]# cat route-n.txt
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 1024 0 0 enp3s0
10.30.1.1 10.30.1.5 255.255.255.255 UGH 20 0 0 tun0
10.30.1.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.30.1.5 128.0.0.0 UG 20 0 0 tun0
162.253.129.98 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0
firewall:
FedoraServer (default, active)
interfaces: enp3s0 tun0
sources:
services: cockpit dhcpv6-client http https nfs openvpn smtp ssh transmission-client vnc-server
ports: 9091/tcp 8080/tcp 10000/tcp
masquerade: yes
forward-ports:
icmp-blocks:
rich rules:
example of issue:
[root@nas help]# cat error.log
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:56:49 CST 2015
xx.xx.xx.xx (real ip address)
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:56:51 CST 2015
xx.xx.xx.xx (real ip address)
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:56:53 CST 2015
162.253.129.98
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:56:54 CST 2015
xx.xx.xx.xx (real ip address)
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:56:56 CST 2015
xx.xx.xx.xx (real ip address)
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:56:57 CST 2015
162.253.129.98
[root@nas help]# date && curl icanhazip.com
Thu Jan 1 15:57:00 CST 2015
xx.xx.xx.xx (real ip address)