LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 01-27-2006, 07:01 AM   #1
rogk
Member
 
Registered: Feb 2004
Location: Finland
Distribution: Mandrake 10.0
Posts: 70

Rep: Reputation: 15
Linux router problem


Hello,
I have a little problem with my Gentoo router. I have 3 interfaces in it. eth0 is connected to WAN and eth1(192.168.0.1) is connected to the LAN computer which has address 192.168.0.5, eth2 (192.168.0.2) is connected to the other LAN computer which has address 192.168.0.10.

Here is the route -e:

Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.5 * 255.255.255.255 UH 0 0 0 eth1
192.168.0.10 * 255.255.255.255 UH 0 0 0 eth2
xx.xxx.xxx.x * 255.255.240.0 U 0 0 0 eth0
loopback localhost 255.0.0.0 UG 0 0 0 lo
default xx.xxx.xxx.x 0.0.0.0 UG 0 0 0 eth0

This is how I'll get from LAN computers(192.168.0.5 and 192.168.0.10) to the internet and to the router of course. But I don't know how I'll have to configure the routing table to get connection between these two LAN computers. I could ping every interface from router with both LAN computers, but not the other LAN computer?
 
Old 01-27-2006, 08:17 AM   #2
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
If you want to use two different interface on a router then by definition you have to use 2 networks. 192.168.0.1,2,5 and 10 are all in the same subnet using the standard mask. By looking at your routing table it looks like what you've done is set eth1 and eth2 with a 255.255.255.255 subnet mask, which is a network with a single host, which by definition means that no other hosts exist within either of those subnet.

Neither of these will work.

eth1 and its attached PC need to share 1 subnet. eth2 and its attached PC need to share another subnet. Each PC will use your router as its default gatway and it will have a default route pointing out to the internet.

Try this

eth1 192.168.0.1 255.255.255.0
eth1's PC 192.168.0.2 255.255.255.0 dg=192.168.0.1

eth2 192.168.1.1 255.255.255.0
eth2's PC 192.168.1.2 255.255.255.0 dg=192.168.1.1

That will sort you out.
 
Old 01-27-2006, 08:57 AM   #3
rogk
Member
 
Registered: Feb 2004
Location: Finland
Distribution: Mandrake 10.0
Posts: 70

Original Poster
Rep: Reputation: 15
I thought that I have to do it like you told me to do. I wasn't sure, so I asked from here. Do I have to enable "802.1d Ethernet Bridging" from kernel?
 
Old 01-27-2006, 09:00 AM   #4
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Not if you are routing. Bridging would allow you to use the same network on two interfaces, but I see no need to there. Your better off routing, as you don't need to muck around with the kernel to make it work.
 
Old 01-27-2006, 10:52 AM   #5
rogk
Member
 
Registered: Feb 2004
Location: Finland
Distribution: Mandrake 10.0
Posts: 70

Original Poster
Rep: Reputation: 15
Thank you very much. Everything is working now as I wanted.
 
Old 01-27-2006, 11:12 AM   #6
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
No worries
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux router problem dawn_angel Linux - Networking 7 02-07-2005 02:26 PM
Linux Router problem makapacs Linux - Networking 3 07-01-2004 03:11 AM
Linksys router + linux problem demowipper Linux - Networking 21 10-08-2003 08:09 PM
linux router problem(HELP ME OUT) bally Linux - Networking 5 06-21-2002 08:26 AM
Linux Router problem kjelle Linux - Networking 2 02-04-2002 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration