Link to home
Start Free TrialLog in
Avatar of swgit
swgitFlag for United States of America

asked on

Routing between LANs and the Internet

Dear Experts,
 
I have a following setup:
 
[list]Home LAN connected to the Internet on 10.0.0.0[/list]
[list]Lab/Test LANs on 192.168.30.x & 192.168.40.x[/list]
[list]VMnet3 for .30 and VMnet4 for .40[/list]
 
I would like some of the machines in the Lab/Test LANs to access the Internet, so I'd tried to setup a router.. without having any success so far
 
Router (RHEL6.9):
eth0 = 10.0.0.100/24, GW: 10.0.0.1
eth1 = 192.168.30.254/24
eth2 = 192.168.40.254/24
 
#netstat -nr
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.30.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
192.168.40.0    0.0.0.0         255.255.255.0   U         0 0          0 eth2
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
0.0.0.0         10.0.0.1        0.0.0.0         UG        0 0          0 eth0
 
Desktop on .30 (also RHEL6.9)
eth0 = 192.168.30.16/24, GW: 192.168.30.254
 
#netstat -nr
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.30.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.30.254  0.0.0.0         UG        0 0          0 eth0
 
I can ping the GW at 192.168.30.254... but that's about it... not sure what is missing...  Please help!  Thanks.

p.s. I also included the images for both settings.
desktop_network_settings.JPG
router_network_settings.JPG
Avatar of Robert Retzer
Robert Retzer
Flag of Canada image

What type of internet service provider ( ISP) do you have? You should receive some type of device from your ISP to connect you to the internet that connects either through the cable or through the tv lines.
Do you have IP forwarding enabled ?
IP Forwarding
Do you have NAT configured. You can't just route to the internet. You need to nat behind a public address.
Avatar of swgit

ASKER

@mihai - yes, i did enable forwarding in /etc/sysctl.conf
Avatar of skullnobrains
skullnobrains

10.0.0.100 is not the internet : it is a LAN address likely provided by your ISP

chances are the ISP will NAT 10.0.0.0/24 to the actual WAN address and ignore other addresses

try and SOURCE NAT 192.168/16 networks to 10.0.0.100
if the address is 10.0.0.34 as i can see in the screenshot, the same applies.

in linux, you can nat to eth0 address without specifying the address which is convenient if that address is acquired through dhcp and changes
To me it looks like
- your ISP is providing you the 10.0.0.0/24 net
- 10.0.0.1 is the ISP NAT router/modem/firewall
- 10.0.0.2-10.0.0.254 are IP addresses available to you and are in the NAT your provider allows to you
- if you want other networks to reach the internet you will have to NAT them on your "router" box to the 10.0.0.X net,
- you can then route the resulting 10.0.0.x address towards the Internet via 10.0.0.1 (the "default route" on your router box)

Usually if you route the 192.168.x.x net to your ISP device it "refuses" to NAT those networks for you - it only knows about the 10.0.0.X network and how to NAT it to the Internet.
+1 thks for the rephrase
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.