LinuxQuestions.org
Help answer threads with 0 replies.
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 08-12-2008, 07:07 PM   #1
technojunkie
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Rep: Reputation: 0
Routing on a 4 NIC Linux box (Ubuntu)


Hi all,

I'm building a router with 4 nics to subnet my network. I have an Ubuntu (Hardy) box with 3 gigabit Intel 1000 pro cards and an on-board Nvidia gigabit card. The routing table I have set up is as follows:

172.20.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
172.20.3.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth3
172.20.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
172.20.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth2
172.20.3.0 172.20.3.1 255.255.255.0 UG 0 0 0 eth3
172.20.2.0 172.20.2.1 255.255.255.0 UG 0 0 0 eth2
172.20.1.0 172.20.1.1 255.255.255.0 UG 0 0 0 eth1
172.20.0.0 172.20.0.7 255.255.252.0 UG 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.20.0.1 0.0.0.0 UG 0 0 0 eth0


The problem I have is that when I ping a machine on the 1 subnet from the 0 subnet I get the following:

sysadmin@jpb:~$ ping 172.20.1.252
PING 172.20.1.252 (172.20.1.252) 56(84) bytes of data.
From 172.20.0.105: icmp_seq=1 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105: icmp_seq=2 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105: icmp_seq=3 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105 icmp_seq=1 Destination Host Unreachable
From 172.20.0.105 icmp_seq=2 Destination Host Unreachable
From 172.20.0.105 icmp_seq=3 Destination Host Unreachable
From 172.20.0.105: icmp_seq=4 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105: icmp_seq=5 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105: icmp_seq=6 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105 icmp_seq=4 Destination Host Unreachable
From 172.20.0.105 icmp_seq=5 Destination Host Unreachable
From 172.20.0.105 icmp_seq=6 Destination Host Unreachable
From 172.20.0.105: icmp_seq=7 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105: icmp_seq=8 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105: icmp_seq=9 Redirect Host(New nexthop: 172.20.1.252)
From 172.20.0.105 icmp_seq=7 Destination Host Unreachable
From 172.20.0.105 icmp_seq=8 Destination Host Unreachable
From 172.20.0.105 icmp_seq=9 Destination Host Unreachable
From 172.20.0.105: icmp_seq=10 Redirect Host(New nexthop: 172.20.1.252)

--- 172.20.1.252 ping statistics ---
10 packets transmitted, 0 received, +9 errors, 100% packet loss, time 9030ms
, pipe 3


I suspect it doesn't think much of my routing table.

Any suggestions please?

Cheers,

Jools
 
Old 08-12-2008, 11:42 PM   #2
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
yeah, your routing table doesn't make sense to me. what is the output of 'ip addr show' on this 4-port router?
 
Old 08-12-2008, 11:55 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Why: 172.20.0.0 172.20.0.7 255.255.252.0 UG 0 0 0 eth0

That would cover networks; 172.20.0.1 - 172.20.3.254
 
Old 08-13-2008, 06:45 AM   #4
technojunkie
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Hiya,

A little clarification is in order. I have 4 subnets, 172.20.0.0, 172.20.1.0, 172.20.2.0 and 172.20.3.0. At the moment, the 0 range is where all the admin staff are set up with static IPs, and the rest inhabit the 2 and 3 ranges with DHCP. Unfortunately, we've now hit 400 PCs which is slowing everything down hence the sub-netting (my first shot at it in the real world).

I tried to set the 0 range up with a 255.255.255.0 mask but Centos (which I originally tried) didn't like it although Ubuntu doesn't seem to object. After trying it out I found this tutorial - http://www.comptechdoc.org/os/linux/...ugrouting.html and tried to base it on that although I've obviously bollocks'd it up.

In "man route" it specifies that * is entered in the gateway address column if no gateway is specified but I get 0.0.0.0 so I assume this is the same thing.

Anyway, I drew up a table of the three networks matching it to the example and entered them in order and this is what I got:


172.20.3.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth3
172.20.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
172.20.0.7 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
172.20.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth2
172.20.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
172.20.3.0 172.20.3.1 255.255.255.0 UG 0 0 0 eth3
172.20.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
172.20.2.0 172.20.2.1 255.255.255.0 UG 0 0 0 eth2
172.20.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.20.1.0 172.20.1.1 255.255.255.0 UG 0 0 0 eth1
172.20.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.20.0.0 172.20.0.7 255.255.255.0 UG 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.20.0.1 0.0.0.0 UG 0 0 0 eth0

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:1b:21:21:cd:68 brd ff:ff:ff:ff:ff:ff
inet 172.20.0.7/24 brd 172.20.0.255 scope global eth0
inet6 fe80::21b:21ff:fe21:cd68/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:1b:21:21:02:8b brd ff:ff:ff:ff:ff:ff
inet 172.20.1.1/24 brd 172.20.1.255 scope global eth1
inet6 fe80::21b:21ff:fe21:28b/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:1b:21:21:02:8a brd ff:ff:ff:ff:ff:ff
inet 172.20.2.1/24 brd 172.20.2.255 scope global eth2
inet6 fe80::21b:21ff:fe21:28a/64 scope link
valid_lft forever preferred_lft forever
5: eth3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:14:85:e4:37:96 brd ff:ff:ff:ff:ff:ff
inet 172.20.3.1/24 brd 172.20.3.255 scope global eth3
inet6 fe80::214:85ff:fee4:3796/64 scope link
valid_lft forever preferred_lft forever


Still got the sma ehting though.

Cheers.
 
Old 08-13-2008, 08:20 AM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Please show code output in bbcode [ code ] [ /code ] brackets so that output is formatted in a more easily viewed fashion.

The routes in orange are superfluous; you can remove them. The system will add the correct route for the NIC's network when you bring up a NIC, so you don't need to add your own routes
Code:
172.20.0.7     0.0.0.0  255.255.255.255 UH 0 0 0 eth0
172.20.0.0     0.0.0.0  255.255.255.0   U  0 0 0 eth0
172.20.0.0  172.20.0.7  255.255.255.0   UG 0 0 0 eth0

172.20.1.1     0.0.0.0  255.255.255.255 UH 0 0 0 eth1
172.20.1.0     0.0.0.0  255.255.255.0   U  0 0 0 eth1
172.20.1.0  172.20.1.1  255.255.255.0   UG 0 0 0 eth1

172.20.2.1     0.0.0.0  255.255.255.255 UH 0 0 0 eth2
172.20.2.0     0.0.0.0  255.255.255.0   U  0 0 0 eth2
172.20.2.0  172.20.2.1  255.255.255.0   UG 0 0 0 eth2

172.20.3.1     0.0.0.0  255.255.255.255 UH 0 0 0 eth3
172.20.3.0     0.0.0.0  255.255.255.0   U  0 0 0 eth3
172.20.3.0  172.20.3.1  255.255.255.0   UG 0 0 0 eth3

127.0.0.0      0.0.0.0    255.0.0.0     U  0 0 0 lo
0.0.0.0     172.20.0.1      0.0.0.0     UG 0 0 0 eth0

Last edited by Mr. C.; 08-13-2008 at 08:22 AM.
 
Old 08-13-2008, 09:09 AM   #6
technojunkie
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Sorted!!

Turned out the test box I had on the 1 subnet had been rebooted and the netmask had gone from the 255.0 that I'd put in using ifconfig to 252 from the original network setup.

Reset the netmask and went back to my original:

Destination Gateway Genmask Flags Metric Ref Use Iface
172.20.3.0 0.0.0.0 255.255.255.255 UH 0 0 0 eth3
172.20.1.0 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
172.20.0.7 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
172.20.2.0 0.0.0.0 255.255.255.255 UH 0 0 0 eth2
172.20.3.0 172.20.3.1 255.255.255.0 UG 0 0 0 eth3
172.20.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
172.20.2.0 172.20.2.1 255.255.255.0 UG 0 0 0 eth2
172.20.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
172.20.1.0 172.20.1.1 255.255.255.0 UG 0 0 0 eth1
172.20.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.20.0.0 172.20.0.7 255.255.255.0 UG 0 0 0 eth0
172.20.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 172.20.0.1 0.0.0.0 UG 100 0 0 eth0


and it worked.

Never assume as they say.

Thanks for taking the time to help guys,

All the best,

Jools
 
  


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
1 Linux Box 3 NIC problem SBN Linux - Networking 9 01-30-2007 07:49 PM
Linux Box Router doing Dynamic routing like BGP, and loadbalancing Swakoo Linux - Networking 6 01-27-2007 12:04 AM
help please :) Problem routing through Linux box jrd426 Linux - Newbie 22 03-11-2006 06:26 PM
routing two isp connection to lan using linux box tisson Linux - Networking 2 09-08-2004 08:39 PM

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

All times are GMT -5. The time now is 09:50 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