Background:
I have a gateway to the internet through the hardware router at 192.168.1.1.
I have two network interfaces, a wired eth0 and a wireless wlan0.
The two interfaces have the same fixed IP address 192.168.1.2.
I use “traditional method with ifup” for configuring the network interfaces.
I encode the address 192.168.1.1 in the correct place for gateway in Yast’s Network card config GUI.
Problem:
An hour or so after I boot up, I lose the internet. When I look I find that the response to the command : route, changes from this:
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
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
to this:
Kernel IP routing table
(hangs here)
and I lose contact with the internet.
Sometimes if I run the command: rcnetwork restart, I get the correct behaviour back plus the internet back. But sometimes I don’t and I have to reboot. If I check in Yast Network Configuration GUI when computer has lost the internet, the code for the gateway is still there, even though the underlying network has lost it.
Is there a command or commands or a script I can write to run when this happens so I can restore the network’s knowledge of the location of the gateway?
[If there is such a script I would put it into a 5 or 10 minute repeating cron job until openSUSE 11.2 comes out – I don’t mind – “whatever works, works” I say.]
Or some other idea?
I have a static LAN, so no need for “managing” network switching with a network manager.
Though I can’t see why you are experiencing issues. Has this just started happening?
No – my patience ran out, that’s all. And I suppose I exaggerated – maybe reboot needed only twice a day and “rcnetwork restart” succeeds in fixing it maybe twice a day – maybe total of four irritations per day.
I don’t need to. I understood that it would be OK, so I left it like that. But I’ll turn one of them for 24 hours and see how it goes, and report back.
I also use the same IP-address for both eth0 and wlan0 (because of port forwarding in my router) and with the right STARTMODE it is very convenient and absolutely reliable.
If cable is plugged in, eth0 is used exclusively and wlan0 is automatically deactivated, if I “go wireless” wlan0 is automatically activated on unplugging the cable.
To be sure that also eth0 will always be preferred if both interfaces are up (should normally not happen with ifplugd) setting metrics for the routing table is also an idea.
You should not have two interfaces sharing the same IP, as you don’t want the neighbours to have the same address you have.
In my network there are 2 PC’s dual-booting, even then I take care that the IP’s differ. If my son runs XP, his IP is …210, if he runs openSUSE it’s …211
Making wireless static brings a possible risk: You do need a gateway address, and that’s not going to be 192.168.1.1 everywhere.
Therefore I’d suggest you configure the wired interface with a static IP, the wireless with DHCP.
Yes, “on cable connect” sounds strange for a wireless interface, the real meaning could be described as “if the interface has sucessfully joined a network”.
With wired connections this literally means plugging in a cable, with wireless it is just difficult to describe in a few words fitting in a small checkbox/dropdown menu, so it also says “on cable connect” there, although it sounds funny.
Joining a wireless network means that you are associated to the access point, so presumably this is checked by the ifup-scripts and ifplugd-demon for this option.
To give you an idea what it looks like, when you use this method:
takes care, that your wired connection will always be preferred if a cable is plugged in, as the priority for eth0 is higher than for wlan0 (which is the default).