Have to add gateway via route after each boot

I am running openSUSE 11.2 on HP dv2000, dual core, with 2G ram.
After each boot the gw has to be added manually.

Here is the resolve.conf
search wildblue.com
nameserver 75.104.128.61

After the gw is added the wireless internet works just fine.

Any suggestions?

Thanks

Did you use yast to configure the gateway? That should be permanent.

The gateway is not in /etc/resolv.conf but in /etc/sysconfig/network/routes containing a line like this:

default nnn.nnn.nnn.nnn - -

where nnn is the IP number of the gateway.

Thanks for the response vodoo.
There was not a routes file. I therefore went into yast configured the gateway. It wrote the file and placed this into it:
default 192.168.1.1 - eth1
default 192.168.1.1 - eth0

I booted the system and checked the gateway with route -n it was not there. I am using the knetworkmanager and went into ‘manage connections’ and found the Client DHCP ID and added it there but still no luck.

I still have to add the gateway via route command.

Is there anything else that I need to check??

Thanks for your help.

Also the wired connection adds the gateway just fine.

Thanks.

There was not a routes file. I therefore went into yast configured the gateway. It wrote the file and placed this into it:
default 192.168.1.1 - eth1
default 192.168.1.1 - eth0

This doesn’t look good at all. You can’t have two default routes for the same network on two different network cards. eth0 and eth1 must have two different networks assigned and only one of them can be connected to the router/modem.

You say that the wired network is ok but wireless doesn’t work. Wireless gets parameters via DHCP. That should set the gateway as well. You have your wireless on a different subnet - do you?

Can you please post the result of the following commands (enter this in a terminal):

/sbin/ifconfig
/sbin/route -n

Sure. This is after route add has been run.

IFCONFIG:
eth0 Link encap:Ethernet HWaddr 00:16:D3:AD:C4:9B
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17 Base address:0xe000

eth1 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:85
TX packets:352 errors:7 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:272495 (266.1 Kb) TX bytes:38064 (37.1 Kb)
Interrupt:19

lo Link encap:Local Loopback

ROUTE -N:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1

I deleted the entries in routes file.
I then went into yast and under routes entered the gw.
I rebooted.

NOTE: This is what I saw just after the system came up.
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1

linux-jh3c:~ # cat /etc/sysconfig/network/routes
default 192.168.1.1 - -

linux-jh3c:~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:D3:AD:C4:9B
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17 Base address:0x8000

eth1 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:3
TX packets:18 errors:7 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:342 (342.0 b) TX bytes:3905 (3.8 Kb)
Interrupt:19

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:90 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6332 (6.1 Kb) TX bytes:6332 (6.1 Kb)

NOTE: I decided to plug in the cat5 lan cable and this is what I saw.
linux-jh3c:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1

linux-jh3c:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1

linux-jh3c:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
linux-jh3c:~ #

As can be seen the gw was added, and ifconfig looks like this.

ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:D3:AD:C4:9B
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:d3ff:fead:c49b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2691 errors:0 dropped:0 overruns:0 frame:0
TX packets:2726 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1805862 (1.7 Mb) TX bytes:461427 (450.6 Kb)
Interrupt:17 Base address:0x8000

eth1 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:19
TX packets:22 errors:7 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4777 (4.6 Kb) TX bytes:4289 (4.1 Kb)
Interrupt:19

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:90 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6332 (6.1 Kb) TX bytes:6332 (6.1 Kb)

NOTE: I then unplugged the lan cable and this is what I saw.
linux-jh3c:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1

linux-jh3c:~ #
ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:D3:AD:C4:9B
inet6 addr: fe80::216:d3ff:fead:c49b/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:2740 errors:0 dropped:0 overruns:0 frame:0
TX packets:2771 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1840112 (1.7 Mb) TX bytes:465765 (454.8 Kb)
Interrupt:17 Base address:0x8000

eth1 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:22
TX packets:23 errors:7 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4777 (4.6 Kb) TX bytes:4385 (4.2 Kb)
Interrupt:19

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:90 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6332 (6.1 Kb) TX bytes:6332 (6.1 Kb)

linux-jh3c:~ # cat /etc/sysconfig/network/routes
default 192.168.1.1 - -
linux-jh3c:~ #

As can be seen plug the lan cable in and the gw comes up, unplug the cable and the gw is gone. And back to added the gw manually.

Hopes this helps, and thanks for your help.

Hi again

(This is in reply to post #6)

What I can see is the following:

eth0 is not configured. It has no IP address assigned to it. In case you do so in the future please assign a number from a different network, e.g. 192.168.2.105

eth1 is within the 192.168.1.0 network. It had traffic and appears to work. It’s connected to a router having IP 192.168.1.1 and this is your gateway / default route. This look good. Can you confirm it works?

Now for the WLAN: I can’t see any configuration for it. It doesn’t exist at all. Coming back to your first post. You said:

Here is the resolve.conf
search wildblue.com
nameserver 75.104.128.61

Can you confirm this is really a nameserver? When I reverse-resolve it I get:

;; ANSWER SECTION:
61.128.104.75.in-addr.arpa. 86400 IN    PTR     75-104-128-61.cust.wildblue.net.

This looks very much like a customer IP number. (I’m confused)

And why did you set ‘search wildblue.com’ ? This is a public 2nd level domain. So if you ping www it would try ‘www.wildblue.com’. It’s normal to add the domain for your private LAN here.

Tell me something about your wireless. Where does it connect to? And who is providing the DHCP? Is it a wireless router? I suspect there is something important we don’t know about. That makes it very difficult to see a starting point to search for the root of your problem. A brief description of your complete setup would be very helpful.

Regarding post #7:

Can you see this:

ifconfig
eth0 Link encap:Ethernet HWaddr 00:163:AD:C4:9B
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:d3ff:fead:c49b/64 Scope:Link 

...

eth1 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link

You have two different ethernet network cards (NIC’s) within the same network. This is a No NO! That’s why it sets 2 default routes, one for each card. Change the IP number for eth0 (a choice could be 192.168.2.100). Or vice versa. Depends on which ethernet card gets connected to the router.

Follow this simple rule: Your router and the NIC connected to it must be within the same network. You have chosen a C-class network, which means that 192.169.1 is common to both and the last number differs (and can’t be 0 or 255). All other NIC’s whatsoever must be in a different network (e.g. 192.169.2, 192.169.3 …)

Then I see that you still have enabled IPV6. Disable it. There is a lot of advice on this forum how to do this.

Once you have fixed these items report back what you see. There is no use in trying to debug this any further until these two items have not been corrected.

We have satellite service from wildblue and there satellite modem. The name server for wildblue is 75.104.128.61 and wildblue.com is there domain.

Coming from the satellite modem is our Linksys wireless/wire router. Its gateway is 192.168.1.1.

When the wireless card was configured it defaulted to the name eth1 and I left it at that.

I suggest you do the following:

  1. You plug in the cable coming from the router into the card appearing as eth1 (ok, do you?)

  2. I suggest that you use the traditional method with ifup from yast (that’s under the global options)

  3. You leave eth1 with IP 192.168.1.105 and you set the IP for eth0 to 192.168.2.100

  4. In the Hostname/DNS menu you set ‘Nameserver_1’ to 75.104.128.61 and the domain search to the domain name you have choosen for your internal LAN domain (something like ‘foobar.lan’).

  5. In the routing menu set the standard IPv4 gateway to 192.168.1.1.

  6. Verify that /etc/resolv.conf looks like this:

search foobar.lan
nameserver 75.104.128.61
  1. Verify that the nameserver works. Try to ping it
ping 75.104.128.61

and check that it works:

dig @75.104.128.61 www.google.com
  1. Now again: what’s the result of the ‘route’ and ‘ifconfig’ commands after you did these changes?

No the cable is plugged in the eth0 card, the eth1 card is the wireless connection.

eth0 Link encap:Ethernet HWaddr 00:16:D3:AD:C4:9B
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:d3ff:fead:c49b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:749 errors:0 dropped:0 overruns:0 frame:0
TX packets:813 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:504889 (493.0 Kb) TX bytes:102652 (100.2 Kb)
Interrupt:17 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.2.100 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:19

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:280 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:25106 (24.5 Kb) TX bytes:25106 (24.5 Kb)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

The eth1 card is not passing any traffic. I wonder if that is because of the 169.254.0.0 destination.

The changes were made as you suggested.

Thanks Vodoo for your support.

Now that looks a LOT better, doesn’t it? I can see that you still have IPv6 enabled which you probably don’t need. Let it as it is for the time, it won’t do any harm.

eth0 shows some traffic and appears to work. It is your door to the gateway and the routing table looks ok as well. The destination 169.254.0.0 is no problem.

What is eth1 connected to? You say: ‘the eth1 card is the wireless connection’ but I don’t understand what you mean. Is this another way to the internet? You can have only one default route at a time. But if you have an URL resolving to 192.168.2.40 (as an example, just anything within the 192.168.2.0 and/or 169.254.0.0 networks) it would be reached through eth1. Anything else goes to eth0.

Can you please explain what still doesn’t work and what exactly you want to achieve?

eth0 does work well, and is set to only come up when the cable is plugged in.

eth1, which I changed the name to wlan0 btw due to me getting confused between the two , is the onboard wireless card in my laptop, HP dv2000. It would work the way it was set previous if the gateway was added manually. On openSUSE 11.1 the previous connection worked well, the wireless card made connections without any manually intervention. I am using this card when I am not connected to the cable. It is set to start on boot and the cable card is set to start only when the cable is plugged in. I startup the laptop without the cable plugged in and eth0 does not start at all. So the laptop has an ethernet card and a wireless card.

After we made the changes the wireless card, wlan0, would not work at all, and the gw could not be added it manually. These errors started showing up in the messages log:
Nov 29 11:00:05 linux-jh3c auditd[3224]: Error sending signal_info request (Operation not supported)
Nov 29 11:01:37 linux-jh3c ifup-wireless: Error for wireless request “Set Encode” (8B2A) :

wlan0 is set to these settings in ifcfg-wlan0:
BOOTPROTO=‘dhcp4’
BROADCAST=’’
ETHTOOL_OPTIONS=’’
IPADDR=’’
MTU=’’
NAME=‘BCM4312 802.11a/b/g’
NETWORK=’’
REMOTE_IPADDR=’’
STARTMODE=‘auto’
USERCONTROL=‘yes’
WIRELESS_AP=’’
WIRELESS_AUTH_MODE=‘sharedkey’
WIRELESS_BITRATE=‘auto’
WIRELESS_CA_CERT=’’
WIRELESS_CHANNEL=’’
WIRELESS_CLIENT_CERT=’’
WIRELESS_CLIENT_KEY=’’
WIRELESS_CLIENT_KEY_PASSWORD=’’
WIRELESS_DEFAULT_KEY=‘0’
WIRELESS_EAP_AUTH=’’
WIRELESS_EAP_MODE=’’
WIRELESS_ESSID=‘mudboy’
WIRELESS_FREQUENCY=’’
WIRELESS_KEY=’’
WIRELESS_KEY_0=‘h:
WIRELESS_KEY_1='h:

WIRELESS_KEY_2=’’
WIRELESS_KEY_3=’’
WIRELESS_KEY_LENGTH=‘128’
WIRELESS_MODE=‘Managed’
WIRELESS_NICK=’’
WIRELESS_NWID=’’
WIRELESS_PEAP_VERSION=’’
WIRELESS_POWER=‘no’
WIRELESS_WPA_ANONID=’’
WIRELESS_WPA_IDENTITY=’’
WIRELESS_WPA_PASSWORD=’’
WIRELESS_WPA_PSK=’’
PREFIXLEN=‘24’

The password was redacted in this post for security reasons everything else is as it was.

I would like to have the wireless card to come up with the gw added. It now comes up with no gw. When I add the gw manually it works just find.

Do you think the driver is causing the problem?? Thanks for hanging in with me Vodoo.

ifconfig now:
wlan0 Link encap:Ethernet HWaddr 00:1A:73:8F:93:79
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:73ff:fe8f:9379/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:773 errors:0 dropped:0 overruns:0 frame:174
TX packets:802 errors:7 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:508284 (496.3 Kb) TX bytes:107901 (105.3 Kb)
Interrupt:19

eth0 unplugged
eth0 Link encap:Ethernet HWaddr 00:16:D3:AD:C4:9B
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17 Base address:0xc000

linux-jh3c:/home/carl # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 2 0 0 wlan0
default 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0

In knetworkmanager, manage connections, edit the wireless connection properties, go ‘IP-address’, pulldown ‘Basic Settings’ to select ‘Routes’ and make sure both options are unchecked. That should do it.

Thank you Knurpht, that did it. Wireless works!!!
Thank you Vodoo you are the best.

IMHO openSUSE 11.2 is the best flavor of Linux anywhere, I have been with it now for around two years now after trying 3 to 5 others. And the willingness of this fourm to share knowledge goes along way in making opneSUSE the best.

Thank you both very much.

The greatest joy of all;
is to find that the light at the end of the tunnel;
is not a train after all.