LinuxQuestions.org
Visit Jeremy's Blog.
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 04-23-2003, 04:43 PM   #1
Morthoseph
LQ Newbie
 
Registered: Apr 2003
Location: Colorado
Distribution: Redhat 9
Posts: 3

Rep: Reputation: 0
Unhappy Redhat 9 and DHCP/Routing


Ok guys, here is something I have been working on since 9 came out. I installed Redhat 9 and am trying to get it connected to the net. Config is as follows:

eth0 is to my lan --> 192.168.1.1
eth1 is cable modem --> some.ip.that.is.dynamic

eth0 is static (of course)
eth1 is set to dhcp.

It will NOT connect to the net using the nice little setup script so after poking around, found that the routing table is not correct...

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
12.252.208.0 * 255.255.254.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.254 0.0.0.0 UG 0 0 0 eth0

No matter what I do I cannot add or del anything to this table as root. The 169.254.0.0 is the kicker... I removed both nic's and rebooted. I installed each one separately, and after first boot, saw the 169.254.0.0 attach to LO, then put in first card and it attached to eth0, and then finally as you see it now. I cannot get rid of it and I am not able to add another default route to go to eth1 so I can get out of my lan. Also, can't ping anything either, but my other systems.
Any help would be appreciated.
 
Old 04-25-2003, 03:26 AM   #2
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
you should be able to delete the default route that is existing by typing

route del default

and enter a new one by typing

route add default gw 12.252.208.x

(you will need to find the exact address for x it will be the machine you are conecting to)

anyway the real question is how are these addresses getting like this. The last default gateway can probably be sorted by checking the config file for eth0, from memory if there is mention of a gateway in if ifcfg-ethx file it sets up a default gateway, I think it replaces any existing gateways as well. check the /etc/sysconfig/network-scripts directory particularly ifcfg-eth0 and the ifup script.

now when you are connecting to the net you want to generate that default gateway so depending on what sort of connection you have will depend on how that happens. Check through the config files that are relevant and look for some reference to the default gateway and make sure it is set to ON or YES or whatever. You may have something already in place for the ifcfg-eth1 file which may be setting itself up before the cable modem connection takes place. This would explain the other entry in the routing table. You should probably remove the ifcfg-eth1 file (or at least rename it) to get that to go away.

let us know how you go
 
Old 04-25-2003, 09:25 AM   #3
webtoe
Member
 
Registered: Apr 2001
Location: Cambridge, England
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617

Rep: Reputation: 30
It also may be possible that you have the routing daemon running. It will set up the routing table as connections are brought up so it could be this which is causing trouble. do a
Code:
ps -e | grep routed
To see if it is.

HTH

Alex
 
Old 04-25-2003, 11:38 AM   #4
Morthoseph
LQ Newbie
 
Registered: Apr 2003
Location: Colorado
Distribution: Redhat 9
Posts: 3

Original Poster
Rep: Reputation: 0
Hey Sutekh,

Ok, I removed the default route and added the ip. Here are the ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

the ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.1.1
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
TYPE=Ethernet
USERCTL=no
PEERDNS=no
NETWORK=192.168.1.0
BROADCAST=192.168.1.255

and the ifcfg-eth1

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=dhcp
USERCTL=yes
PEERDNS=yes
TYPE=Ethernet

and after removing and adding the default route, here is the route info:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
12.252.208.0 * 255.255.254.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 12.252.208.144 0.0.0.0 UG 0 0 0 eth1

That didn't work so I changed the mask to 255.255.254.0 and that didn't work so I removed the 12.252.208.0 seeing how the showed the same netmask and that still didn't work. One thing that you will see from the configs above is that in no file does it show that 169.254.0.0 address. I don't know what that is or where it is coming from or if that is even affecting the problem of no network accessibility.

Thanks for your help!

Oh, and webtoe, routed is NOT running.
 
Old 04-25-2003, 04:38 PM   #5
DigitalTygrrr
Member
 
Registered: Apr 2003
Location: /home/BillyGoatStrut
Distribution: Ubuntu, Debian "Sarge", Mac OS X
Posts: 110

Rep: Reputation: 15
the 169.254.0.0 is the windows Automatic Private IP Addressing(APIPA). if your box cannot detect dhcp, you may want to try to disable this service in windows.

are you using a windows OS on the machine that keeps coming op with 169.254.x.y?
 
Old 04-25-2003, 08:21 PM   #6
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
I noticed that ip range come up on windows pc's at work and figured it must be some built in windows thing (thanks DigitalTygrrr now I know what it is called and can find out a bit more about it) but is it something that is broadcast? how would the linux box be picking it up?

anyway back to your problem Morthoseph,

The above routing looks sound, the default route is being sent to you from the ISP, the fact that you have the two addreses on eth1 is not likely to be of any real affect as long as one of the addreses is a real address (I sometimes use alias addresses for example to effectively give two differeent addresses to the same NIC).

with the default gateway in place any ip addresses not local (that is anything on the gateway machine not in the 192.168.1.x or 169.254.208.x or 127.x.x.x range) should be thrown at the default gateway. I am assuming at this stage you are not trying to activate any sort of local ip masq or port forwarding just trying to get onto the net.

How are you testing this connection to determine that it is failing. If you are using ping from this box are you ping'ing a host that you know for a fact returns ping requests? At lot of hosts don't. Also are you tring to ping with a name rather than an ip? maybe there is a DNS problem.

I would suggest the following.

ping 208.185.179.12

this is an address at www.apache.org that will definately respond to ping packets.

If this fails try doing a traceroute to the same address.

you could also try pinging the gateway address (the default route)

hopefully as part of the dhcp setup for your eth1 card you also got DNS server details so you can try to ping www.apache.org or whatever to see if you get a response.

Oh and on a side note, best not to post actual live ip addresses unless you are confident of your firewall (I know that seems like a bit extreme seeing as you can't even get on the net yet but just 'cause you are having trouble getting out doesn't mean other people are going to have trouble getting in). After we get you online, if you don;t have one already we need to get you up and running with at least a basic firewall.
 
Old 04-26-2003, 12:39 PM   #7
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
You will get served the 169.254.~.~ address if dhcp is unsuccessful.

I suggest you start looking at that first, get a clean ip allocation.
Try the dhcp setup without the firewall, then once successful, with the firewall.
 
Old 04-26-2003, 06:41 PM   #8
Morthoseph
LQ Newbie
 
Registered: Apr 2003
Location: Colorado
Distribution: Redhat 9
Posts: 3

Original Poster
Rep: Reputation: 0
Sutekh, that is really odd. That worked this time. After I got your message, I booted into Linux and had to remove the default gateway and then re-add my gateway and it now is working. I am online in Linux. Now I have to find out why and how to keep that correct route settings, but unfortunately, I have to go out of town for the next week. And yes, I have a stout firewall but it is not implemented just yet.
I haven't had the time. I appreciate all the replies and the help!
See you all next week!
 
  


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
routing problem with dhcp and localhost drowstar Linux - Networking 0 01-03-2005 09:23 AM
covering dhcp & static routing redlinux04 Linux - Networking 3 09-08-2004 03:44 AM
dhcp ipmasq routing problem? ravenst1 Linux - Networking 0 08-27-2004 08:04 AM
interface ok, dhcp ok, routing gw not ok- help sokar Linux - Wireless Networking 4 02-04-2004 11:39 AM
DHCP Routing Question WeNdeL Linux - Networking 3 09-24-2003 01:18 PM


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