Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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???
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...
[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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.