LinuxQuestions.org
Help answer threads with 0 replies.
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 10-01-2003, 07:14 PM   #1
MagDaddy
Member
 
Registered: Jul 2003
Posts: 31

Rep: Reputation: 15
Default route question


Greetings,

I have a server sitting on the public internet. netstat -rn shows that it's default gateway is 64.1.1.100.

However, 64.1.1.100 is the IP of the server's interface.

The server has only a couple other routes. 10.0.0.0/8 and 192.168.0.0/16 and they point to a 10. address (on the server's other interface)

The actual correct default gateway should be 64.1.1.1 (HSRP) or 64.1.1.2 (router's interface).

This server has full access to the internet. I can ping www.yahoo.com from this server. Traceroute shows that it goes to the router and out to the net.

How does this server know to send packets to the router, when it is not in the routing table???

-Mag
 
Old 10-03-2003, 04:24 PM   #2
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
Damn good question...

Could you post the output of ifconfig, netstat -rn and the traceroute?

Also, are those falsified addresses? I don't have an issue with it, but I tried testing the IP addresses you gave and didn't get a response. Feel free to phony the subnet, but please do warn that it's been done that way.

(In case we never meet again, my only thought at this point is whether there's a host address for the router. I wouldn't have thought that would be enough, but you never know...
 
Old 10-03-2003, 05:29 PM   #3
MagDaddy
Member
 
Registered: Jul 2003
Posts: 31

Original Poster
Rep: Reputation: 15
This is a cut-and-paste of an IM conversation, so the formatting may be incorrect. Also, the IPs have been changed to protect the innocent.

[root@servername sysconfig]# /sbin/ifconfig eth0
Link encap:Ethernet HWaddr 00:30:48:20:96:19
inet addr:64.1.1.100 Bcast:64.1.1.255 Mask:255.255.255.0


[root@servername sysconfig]# /usr/sbin/traceroute www.yahoo.com traceroute: Warning: www.yahoo.com has multiple addresses;
using 66.218.70.48 traceroute to www.yahoo.akadns.net (66.218.70.48), 30 hops max, 38 byte packets
1 64.1.1.1 (64.1.1.1) 1.146 ms 0.198 ms 0.615 ms
2 63.1.1.1 (63.1.1.1) 1.245 ms 0.717 ms 1.113 ms
3 62.1.1.1 (62.1.1.1) 1.369 ms 0.967 ms 0.740 ms
4 unknown.Level3.net (64.152.69.30) 1.241 ms 0.973 ms 1.365 ms
5 w17.www.scd.yahoo.com (66.218.70.48) 1.241 ms 0.972 ms 0.740 ms

[root@servername root]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
64.1.1.100 0.0.0.0 255.255.255.0 U 40 0 0 eth0
10.0.0.0 0.0.0.0 255.255.254.0 U 40 0 0 eth1
192.168.0.0 10.0.0.5 255.255.0.0 UG 40 0 0 eth1
10.0.0.0 10.0.0.5 255.0.0.0 UG 40 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 64.1.1.100 0.0.0.0 UG 40 0 0 eth0

My default gateway is the IP of the server itself. The traceroute shows that it is not going thru the backend gateway.
 
Old 10-04-2003, 12:10 AM   #4
beatlelane
Member
 
Registered: Jun 2003
Location: Manila
Distribution: Bayanihan+RH9+FC1
Posts: 68

Rep: Reputation: 15
I have a quite similar problem maybe.

Here is my problem,

My eth0 has been configured of pulling IPA from DHCP (private IPA). I want to configure my “alias” eth0:0 to use real IPA without any gateway just to manage our cisco router with a static real IPA. I tried inserting this command to rc.local “ifconfig eth0:0 [realIPA] netmask [realIPANetmask] broadcast [realIPAbroadcast]” but it didn’t work. But when I issue this command to prompt It was working and I can ping the routers.

I am wondering which one comes first, the pulling of ip from the DHCP server or the rc.local batch file?

Any solution for this one? Any help would be much apprecitated.

THANKS.
 
Old 10-04-2003, 11:05 PM   #5
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
Magdaddy,

I'm stumped. About all I can do is say "No you're not insane. That really is weird."

I'm not concerned about the traceroute starting with the real gateway. Hubs, ethernet cards and suchlike generally aren't smart enough to recognize an expired TTL in an ICMP packet.

My setup looks just like yours, except mine DOES have the right gateway address. I have no idea why yours works.



Beatlelane,

I don't know Shrike, so I can't give a definitive answer.
I'm going to give the general rules for tracking down the order things are run in.

(By the way, I wasn't entirely clear on what you were saying. If I understood it right, when you run the ifconfig command to set the alternate IP from the command line, it works. When you put it in rc.local, it doesn't. Let me know if I misunderstood.)

First, look at /etc/inittab. (As far as I know, everybody uses that.)
Second look at the line that says "initdefault". That will tell you what runlevel you boot into. (On Red Hat, 3 is text mode, 5 is GUI, but I have no idea how Shrike divvies them up.)
Third, you should see several lines corresponding to the different runlevels.

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

From this point, it gets a little fuzzy. Different people do different things. If its a vanilla SysV init script, like Red Hat uses, there's a directory for each runlevel. (There's one called /etc/rc.d/rc3.d for runlevel 3, for example.)

Look in that directory and the numbers of the various scripts will tell you what order they run in. (The run from lowest to highest. rc.local is almost always the very last thing run.

If it's not SysV, you're going to have to look at whatever script is running, and figure out how it prioritizes things. The BSD-style stuff is pretty easy - it just calls the scripts one after another like an ordinary shell script.

One thing you might want to do:
run and "ifconfig > /tmp/local.ifconfig" in your rc.local script, before you try to set the alternate IP address. (Send the output of the ifconfig that is setting the address there, too. You might get lucky and get an error message of some kind.)

To address your question directly, I would have expected whatever brings up the network to run well before rc.local does, and the DHCP stuff should run whenever networking is brought up (since DHCP is where it's getting the address from).

If the stuff that brings up the network card(s) is running in the background, I can see a faint possibility of the rc.local starting before the network card has been brought up, but that would be pretty odd. Lots of things depend on the NIC being up before they start.

One possibility is that there ARE dependency checks that keep scripts that aren't ready to run yet from doing anything, and you just haven't tickled the right config files for it to recognize that rc.local needs to have the network up. This is an area where every distro tends to do it their way, and since I don't know Shrike, I'm flailing.

Good luck to both of you.

CHL
 
Old 10-05-2003, 07:14 AM   #6
beatlelane
Member
 
Registered: Jun 2003
Location: Manila
Distribution: Bayanihan+RH9+FC1
Posts: 68

Rep: Reputation: 15
Clacour, thanks for some clarification and for the effort on answering my queries! And of course for that runlevels thing, you’ve opened my Linux eyes wide with this one. ;-)

Actually, I tried a different approach by asking DHCP admin to reserve me a private IPA.

For the Shrike thing, well I don’t know maybe it’s a code name for RH9 seen it every time the system boots up and just excited using it as distribution for my profile, another reason for that of course is I am bit cautious if I use the Redhat name I may not get support from other people in here using different distribution. Of course i want to try some, but Redhat is quite nice to me these days, no more hang ups, one more thing is I didnt pay for it.

Again, thanks…see you around.

Last edited by beatlelane; 10-05-2003 at 07:25 AM.
 
  


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
Not getting a default route wswartz Linux - Networking 4 10-27-2005 11:25 AM
two default route - help me fabiolpi Linux - Networking 2 07-06-2005 06:35 AM
c++ default route bassdemon Programming 1 02-06-2005 10:29 AM
Route to subnet exists but I get "Network unreachable" when adding default route fciuffani Linux - Networking 4 08-18-2004 02:11 PM
Route dialup modem packets back through dialup instead of default route cable modem jogress Linux - Networking 1 10-21-2003 03:48 PM

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

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