HI I have installed cent OS on one PC with 2 network cards eth0 and eth1 eth0 is 192.168.0.244 and eth1 is 10.0.0.1 my gateway to access the net is 192.168.0.254
In order that the 10.X network range can access the internet i added the a route # route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.254
And ""route -n"" gives me the following resulth
[root@squid ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 10.0.0.0 192.168.0.254 255.0.0.0 UG 0 0 0 eth0 10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth1 0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth0
My resolv.conf file looks like this search linuxbox.com nameserver 203.199.113.44 nameserver 203.199.113.27
Now is have one client with ip 10.0.0.5 , when i try to ping 10.0.0.5 ( following is the result ). I am neither able to ping 10.0.0.1 from my client machine ( 10.0.0.5 ) . My firewall is stoped and SElinux is disabled. [root@squid ~]# ping 10.0.0. 8 PING 10.0.0.8 (10.0.0.8) 56(84) bytes of data.
From 203.199.24.154 icmp_seq=1 Destination Host Unreachable From 203.199.24.154 icmp_seq=2 Destination Host Unreachable From 203.199.24.154 icmp_seq=3 Destination Host Unreachable From 203.199.24.154 icmp_seq=4 Destination Host Unreachable From 203.199.24.154 icmp_seq=5 Destination Host Unreachable From 203.199.24.154 icmp_seq=6 Destination Host Unreachable From 203.199.24.154 icmp_seq=7 Destination Host Unreachable
too wired !! from where did i get this IP address ( 203.199.24.154 ) ???
so finally my question is , how is it possible to route traffic through another network class ?
Thanks ! really appreciate all the help this forum provides
On Dec 3, 2007 7:19 PM, Agnello George agnello.dsouza@gmail.com wrote:
In order that the 10.X network range can access the internet i added the a route # route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.254
I'm not sure if this is the right way to do it. What that route says is that whatever traffic you send on the 10.0.0.0 network should be sent through the gateway 192.168.0.254
The nodes on 10.X network should simply add 10.0.0.1 as gateway. And on this machine, you need to add an iptables rule to forward the traffic from 10.X to the gateway.
Now is have one client with ip 10.0.0.5 , when i try to ping 10.0.0.5 ( following is the result ). I am neither able to ping 10.0.0.1 from my client machine ( 10.0.0.5 ) . My firewall is stoped and SElinux is disabled.
That's because all packets meant for 10.0.0.5 were sent to the gateway instead of directly to the host.
On 12/3/07, Agnello George agnello.dsouza@gmail.com wrote:
Now is have one client with ip 10.0.0.5 , when i try to ping 10.0.0.5 ( following is the result ). I am neither able to ping 10.0.0.1 from my client machine ( 10.0.0.5 ) . My firewall is stoped and SElinux is disabled. [root@squid ~]# ping 10.0.0. 8 PING 10.0.0.8 (10.0.0.8) 56(84) bytes of data. From 203.199.24.154 icmp_seq=1 Destination Host Unreachable From 203.199.24.154 icmp_seq=2 Destination Host Unreachable From 203.199.24.154 icmp_seq=3 Destination Host Unreachable From 203.199.24.154 icmp_seq=4 Destination Host Unreachable From 203.199.24.154 icmp_seq=5 Destination Host Unreachable From 203.199.24.154 icmp_seq=6 Destination Host Unreachable From 203.199.24.154 icmp_seq=7 Destination Host Unreachable
too wired !! from where did i get this IP address ( 203.199.24.154 ) ???
I predict you have a line from VSNL!! :P How did I know that? Well the IP 203.199.24.154 belongs to VSNL. Now why are you getting THIS IP while pinging 10.0.0.8? Well, its YOUR fault ;) You've told the routing table to use 192.168.0.254 as the gateway for 10.0.0.0/24 IPs. So it sends the ping requests through THAT gateway. But what the heck is at the other end of 192.168.0.254? VSNL. VSNL's router i.e 203.199.24.154 doesn't know how to route your packet i.e. 10.0.0.8 so IT says "Destination host unreachable". Get it?
Now if you simply want 10.0.0.0/24 IPs to reach the internet then you need to setup NATing on this machine. Search for NAT Linux, IP forwarding etc... you'll get lots of resource.
If you cant do it, pay me. I'll do it for you ;)