Routing using Linux with 2 NIC cards

Posted by Kevin Parker on Server Fault See other posts from Server Fault or by Kevin Parker
Published on 2012-10-11T08:11:09Z Indexed on 2012/10/11 9:40 UTC
Read the original article Hit count: 242

Filed under:
|
|
|
|

Configured Clear OS to be in Gateway mode on a machine with two NIC cards.

eth0:192.168.2.0/24 with ip 192.168.2.27 which is connected to a modem and thus have internet connectivity.

eth1:192.168.122.0/24 with ip 192.168.122.10 which is connected to other machines in LAN through switch.

LAN machines with network 192.168.122.0 is not getting internet.How can they get internet Through Clear OS gateway.I have enabled packet forwarding in clear os using "ip_forward=1" What am i missing?.Can you please help me in this.

Following are the static routing i have added: on LAN machine1 with ip address 192.168.122.11

ip route add 192.168.2.0/24 via 192.168.122.10 dev eth0

ip route show

192.168.2.0/24 via 192.168.122.10 dev eth0 
192.168.122.0/24 dev eth0  proto kernel  scope link  src 192.168.122.11

But still 192.168.2.0/24 network is not reachable.Where can be the problem??

© Server Fault or respective owner

Related posts about linux

Related posts about routing