LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 06-10-2004, 06:53 AM   #1
NetAX
Member
 
Registered: Mar 2004
Location: Boston, MA
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 146

Rep: Reputation: 16
routing from one subnet to another


Hi , I know that this may have been asked before several times. But I could not find a definite answer.

First of all, I recently divided my network with two subnets from my DHCP server.

subnets: 172.16.4.0, 172.16.31.0
eth0 eth1

I want to be able to give internet access to the subnet 172.16.31.0.


I have a crossover connected. to my subnet interface 172.16.31.0 such as this:

COMP<-CROSSOVER--172.16.31.0 subnet-eth1--><SERVER--><-172.16.4.0-subnet-eth0->outsideworld/external router.


Both subnets work as there supposed to .(assigning IP's, etc.)
My 172.16.4.0 subnet can fully access the internet through another router 172.16.4.7, so that doesnt have to be configured for routing.

I have tried using the command "route add" but i cant seem to get it to work properly.

#route -n
Kernel IP routing table
Destination Gateway Genmask Flags Use Iface
172.16.31.255 172.16.4.253 255.255.255.255 UGH 0 eth0
172.16.4.253 172.16.4.7 255.255.255.255 UGH 0 eth1
172.16.4.253 172.16.31.255 255.255.255.255 UGH 0 eth1
127.0.0.1 127.0.0.1 255.255.255.255 UGH 0 lo
172.16.4.0 172.16.4.253 255.255.255.0 UG 0 eth0
172.16.31.0 172.16.31.255 255.255.255.0 UG 0 eth1
224.0.0.0 172.16.31.255 240.0.0.0 UG 0 eth1
224.0.0.0 172.16.4.253 240.0.0.0 UG 0 eth0
0.0.0.0 172.16.4.7 0.0.0.0 UG 0 eth0


Any help would be greatly appreciated.
 
Old 06-10-2004, 05:28 PM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
You need to enable IP forwarding on the box that is in the middle. On the machine labeled COMP in your diagram, you need to add a route to 172.16.4.0/?? (you don't mention what bitmask/netmask you're using) with the gateway being the IP of eth1 on SERVER.

Which ever machine is doing the NAT to the outside world needs a route to 172.16.31.0/?? (again, bitmask/netmask???) and gateway will be the IP of eth0 on your SERVER machine.

Without all three of those things, it won't work.
 
Old 06-16-2004, 08:10 AM   #3
NetAX
Member
 
Registered: Mar 2004
Location: Boston, MA
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 146

Original Poster
Rep: Reputation: 16
I did enable IP forwarding with YaST(I'm using SuSE pro 9.0).

Using the route command I am not able to add bitmask, I am only able to add the netmask (which is 255.255.255.0 by the way).

The only route that is working is the default route which i set to point to 172.16.4.7(Router).

On the 172.16.31.0 subnet I tried doing an NSLOOKUP and was able to receive the IP addresses of yahoo.com in my test.

example:

nslookup yahoo.com

Non-authoritative answer:
Name: yahoo.com
Addresses: 66.218.71.198, 66.94.234.13, 216.109.127.28, 216.109.127.29
216.109.127.30



But when i do ping yahoo.com it comes up as:

ping yahoo.com [216.109.127.28] <--It somehow knows what IP address to ping.


Request timed out.
Request timed out.
Request timed out.
Request timed out.


Doing this on the other subnet gives no problems. Maybe my routing table is wrong? Any help?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
routing http traffic to the correct box on subnet nodine Linux - Security 1 07-15-2004 09:51 AM
Help with Subnet Routing xatmes Linux - Networking 6 04-26-2004 11:52 PM
Aargh!!! Not routing to local subnet sancho5 Linux - Networking 5 02-10-2004 02:11 AM
routing problem with the same subnet nobody Linux - Newbie 1 10-03-2003 02:23 PM
NAT'd subnet routing question ealpert1 Linux - Networking 10 05-19-2003 02:07 PM


All times are GMT -5. The time now is 12:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration