0

How do I setup my routing tables to allow traffic between two subnets

I have a gateway box with two NIC's

1st NIC [eth0] is connected to my outgoing network side and DSL modem and has subnet 192.168.0.0/24

2nd NIC [eth2] is connected to internal LAN and is on subnet 192.168.124.0/24

Obviously from the gateway box I can connect to everything but how do I allow machines from the 192.168.124 subnet connect to the 192.168.0 subnet?

Current tables are (obscured real world IPs):

[root@eagle:~]# ip route
***.***.***.151 dev ppp0  proto kernel  scope link  src ***.****.***.120
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.3  metric 1
192.168.124.0/24 dev eth2  proto kernel  scope link  src 192.168.124.1  metric 1
default dev ppp0  scope link
[root@eagle:~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
***.***.***.151 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0
192.168.124.0   0.0.0.0         255.255.255.0   U     1      0        0 eth2
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
[root@eagle:~]#
  • This is a gateway and I have forwarding already set. What I want is a box on 192.168.124 to bet able to get to 192.168.0 which the gateway knows about. I guess I need rules on GW that most goes to inet except 192.168.0 – Adrian Cornish Mar 20 '15 at 3:54
1

Assuming ipv4 only: 1) as root,

echo 1 > /proc/sys/net/ipv4/ip_forward

2) as root add the line

net.ipv4.ip_forward=1

to the file /etc/sysctl.conf

3) advice: setup a firewall. Firestarter is a good start.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.