I wan't to configure my ubuntu server as shown below.
I need the clients in the 192.168.3.0 network to access internet through gateway 192.168.0.14, but at the same time i need 192.168.0.13 router to communicate with the server for vpn/apache access (rules are defined in the router) from the "outside world".
interfaces file:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.5
netmask 255.255.255.240
network 192.168.0.0
broadcast 192.168.0.15
up ip route add default via 192.168.0.13 dev eth0 metric 100
auto eth1
iface eth1 inet static
address 192.168.3.250
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
routing table:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.13 0.0.0.0 UG 100 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.240 U 0 0 0 eth0
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
This way clients are using only router1 for web access.
I've tried several things, like iproute2 tables...but with no success. If i change the default gateway to 192.168.0.14 internet access works fine on the clients (through router 2), but vpn/apache2 access from the web won't.
Thanks