LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 10-19-2010, 08:02 PM   #1
jfmorales
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Rep: Reputation: 0
Question Static Route Gets Ignored


On a Red Hat Enterprise Linux Server release 5.4 (Tikanga) system,
I set up a static route that unfortunately seems to get ignored.

I set up the static route in the file /etc/sysconfig/network-scripts/route-eth0 as follows:

172.16.96.2/32 via 192.168.219.251

I've restarted the network service and also rebooted a few times.

Hereís my current routing table:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.96.2 192.168.219.251 255.255.255.255 UGH 0 0 0 eth0
192.168.219.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.219.250 0.0.0.0 UG 0 0 0 eth0

I am able to ping 172.16.96.2. However, when I do traceroute 172.16.96.2, it appears that the traffic goes through the default gateway 192.168.219.250 instead of our requested specific gateway 192.168.219.251:

[root@colt-vm-4019c ~]# traceroute -n 172.16.96.2
traceroute to 172.16.96.2 (172.16.96.2), 30 hops max, 40 byte packets
1 192.168.219.250 0.511 ms 0.768 ms 0.753 ms
2 172.16.97.1 3.466 ms 3.452 ms 3.434 ms
3 * * *

I can ping both 192.168.219.251 and 192.168.219.250.

In the route-eth0 file, Iíve also tried using the alternate syntax with ADDRESS0=<IP address> etc, but it didnít work any better. I also tried setting a more general route of

172.16.96.0/24 via 192.168.219.251

But this also didnít help.

The System / Administration / Network tool previously showed a spurious extra NIC called eth0.bak in addition to eth0. I deleted the eth0.bak and rebooted, but this also didn't help. Currently, eth0 is the only NIC on the system.

Thanks in advance for any workarounds or diagnostic tips.
--Joseph
 
Old 10-20-2010, 08:02 PM   #2
fuubar2003
Member
 
Registered: May 2004
Location: Orlando, Florida
Distribution: SLES10/11, RH4/5 svrs, Fedora, Debian/Ubuntu/Mint; FreeBSD/OpenBSD
Posts: 63

Rep: Reputation: 26
I've used iptables snat/dnat prerouting/postrouting rules to do this before. Google/man page it.
 
Old 10-29-2010, 07:44 PM   #3
jfmorales
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks fuubar2003. I belatedly discovered that this was a spurious problem. The traceroute command was not reporting the first hop that the packet took. When I ran tshark on the desired device, I was able to see that the packet was really arriving as expected. Live and learn, I guess.
-- Joseph
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
route-eth - Adding a static route gbwien Linux - Networking 5 02-24-2012 06:15 AM
static route anhtt Solaris / OpenSolaris 1 11-11-2007 04:50 PM
static route dvong3 Linux - Networking 1 01-25-2006 05:42 PM
Help with static route noinfo Linux - Networking 1 10-05-2005 12:40 PM
static route cox Linux - Networking 3 09-30-2003 03:22 PM


All times are GMT -5. The time now is 05:51 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration