LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Linux router problem (https://www.linuxquestions.org/questions/linux-networking-3/linux-router-problem-408551/)

rogk 01-27-2006 07:01 AM

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?

baldy3105 01-27-2006 08:17 AM

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.

rogk 01-27-2006 08:57 AM

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?

baldy3105 01-27-2006 09:00 AM

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.

rogk 01-27-2006 10:52 AM

Thank you very much. Everything is working now as I wanted.

baldy3105 01-27-2006 11:12 AM

No worries :)


All times are GMT -5. The time now is 10:08 AM.