I am running ubuntu server 16.04 and openvpn. I would like to change my settings on the vpnserver so that all the traffic comes in on the current connection (192.168.1.254) and all my traffic goes out my second internet connection (192.168.2.3).
My current routing table:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 ens33
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
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 ens34
Currently I can access the vpn on ens33 but that will use ens33 as default gateway (192.168.1.254). If i add metric to the interfaces so ens34 metric 10 and ens33 metric 100 I cannot reach the server. If I change /etc/ufw/before.rules
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# I CHANGED THIS FROM DEFAULT ens33 to ens34
-A POSTROUTING -s 10.8.0.0/8 -o ens34 -j MASQUERADE
COMMIT
# END OPENVPN RULE
I can access the server to connect but not the internet in browser...
My interface setup is as follows:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto ens33
#iface ens33 inet dhcp
# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.1.72
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
#metric 10
# the secondary network interface
auto ens34
iface ens34 inet static
address 192.168.2.12
netmask 255.255.255.0
broadcast 192.168.2.255
gateway 192.168.2.3
dns-nameservers 8.8.4.4 8.8.8.8
#metric 100
I am missing a route rule or something but I have been banging my head against the wall this last few days on this one... Can someone please help me? I'm any help is appreciated!! Thanks in advance!! <3<3<3