Hello to everyone,
My question is about routing tables using "ip route 2"
Here's the deal:
I have a server(server1 from now on) with eth0(internet connection) and eth1(lan connection).
eth1 have 2 more alias devices = eth1:1 and eth1:2
On my server 1 the eth0=public ip, on eth1=192.168.10.1/24, eth1:1=192.168.20.1/24 and eth1:2=192.168.30.1/24
server1 is running squid and iptables to all 3 networks (eth1, eth1:1 and eth1:2) All of the clients have access to internet.
Now what i want to do is add 3 more networks via a router(linuxBox = server2 from now on) connected to server1 in eth1.
so the network will be like this:
Code:
server1
eth0=internet
eth1=192.168.10.1/24 (connected to server2 and other clients)
clients on eth1 in server1
c1=192.168.10.10/24
c2=192.168.10.20/24
c3=192.168.10.30/24
c4=server2
server2
eth0=192.168.10.254/24 (this one connect to server2)
eth1=192.168.40.254/24 (this connected to clients)
clients on eth1 in server2
c5=192.168.40.10/24
c6=192.168.40.20/24
c7=192.168.40.30/24
The problem is how do i route all traffic from networks 192.168.40.0/24 to server1 so that server1 continues to be the internet server and responds to the network 192.168.40.0/24 routed from server2 ?.
so that i can put the following configuration on clients c5,c6 and c7:
Code:
ip=192.168.40.10/24 an so on...
gateway=192.168.10.1/24
dns1=192.168.10.1/24
server2 will only work for routing and a little of firewall.
I have research google.com for info on this, but without any success.
Have try this commands on server2
Code:
ip route add 192.168.10.0/24 via 192.168.10.254 dev eth0
ip route add 192.168.40.0/24 via 192.168.40.254 dev eth1
The iptables in server2 is clean an with policy ACCEPT for all.
Please help, if you need more info just ask please