0

I wan't to configure my ubuntu server as shown below.

enter image description here

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

1
  • but how can I accomplish this without changin thr router2 ip? because this router has an external fixed IP to connect to other servers in the 192.168.0.x network... btw the router is a modest zyxel Prestige 650H/HW-31. can I do this setting dhcpd.conf routers option? or via Classless Static Routes (serverfault.com/questions/536612/…)? thanks Apr 10, 2014 at 14:02

2 Answers 2

0

If router2 is connected to an ethernet network ( hub / switch ) that is also connected to the dhcp clients, then they all need to be configured using a common IP address block. In this case 192.168.3.x

What is router2 ? ( cisco / juniper / linksys / openwrt ?? )

0

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".

Whit that description i think you can make a few things, identify the problems and isolate them:

1º One server for 2 Gateways -> Ubuntu server 16.04 to 2 gateway at same time.

2º 2 network address on same adapter. 2 networks Fisical and Vlan (192.168.0.0/24 and 192.168.3.0/24) ->How to setup and save vlans on ethernet

3º Dhcp server over Vlan and routing petitions to 192.168.0.14. ->How do I install and configure a DHCP server?

4º Valorate if you want to create a security Proxy/gateway/firewall for your client lan (192.168.3.0/24) or only a neutral server. This is convert your server in a router and may be its more easy to buy a network switch/router/firewall with administrative capabilitys.

This can be very complex, you need to touch iptables and stablish rules for port fordwarding. If you make this with using eth1 for the tow networks, a trained/Experienced user can jump your security and directly use any 192.168.0.XX/24 ip to use 192.168.0.14 as gateway. The recomended way to make this its adding another fisical adapter (like eth2) and this is the only fisical conection to 192.168.0.14 ip, fisical isolating the networks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .