Gateways won't work

Issues Related to Networking (Wired and Wireless)

Moderator: Moderators

Gateways won't work

Postby the_gamer » Wed Jan 04, 2012 15:17

Hi folks,

I installed ifpludg and it works fine when having the network with cable installed. When switching the connection(dragging the cable out), eth0 is deactivated and wlan0 is activated. That is fine and it also works the same way getting back. First I configured eth0 using net-setup as http://wiki.sabayon.org/index.php?title ... king_Guide is telling me. But I couldn't find out where net-setup saves the gateway, I greped through a lot of folders but nowhere was the saved gateway to be found. Where is it stored?

But now here is the problem. After the cable is dragged out, the standard gateway is removed and doesn't come back no matter what is done! I have to enter a shell, become root and adding it again by hand.
I also tried to add the lines for adding the gateway into /etc/ifplugd/ifplugd.action but to no avail(yes, network was restarted, I even rebootet). So I removed those lines again. Now I created another script: /etc/NetworkManager/dispatcher.d/02-gateway-up-down.rc with the same rights as 01-netmount-up-down.rc saying
Code: Select all
#!/bin/sh

# these are the args passed by NetworkManager
MY_DEV_NAME="$1"
MY_NM_ACTION="$2"

# restart network mounts service in any case, networking setup is changed
# FIXME, remove: just restart myself, do not restart
# services that depend on me
if [ "${MY_NM_ACTION}" = "up" ]; then
        route del default gw>/dev/null 2>&1
        route add default gw my.gateways.ip


fi


But now I have no gateway no matter what I do, not even at bootup. Adding it by hand still works but it is way too annoying to do that everytime. It can't be that hard to add the right gateway automatically, can it? Could anybody help me out?

Where are the gateways stored? Where can I change them? How to still have the right gateway after ifplugd changed the device?

Thanks in advance, I'm trying for over 7hours now and getting out of ideas.
the_gamer
Baby Hen
 
Posts: 2
Joined: Wed Jan 04, 2012 15:07

Re: Gateways won't work

Postby Fitzcarraldo » Mon Jan 09, 2012 21:37

Which version of SL?

Fully updated and upgraded to current packages in Entropy repository?

Which version of kernel?

Which desktop environment?

32-bit or 64-bit version?

Any error messages in /var/log/messages?

Try Re: Can't locate Iptables rules file.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Gateways won't work

Postby the_gamer » Tue Jan 10, 2012 17:38

Fitzcarraldo wrote:Which version of SL?

I installed Sabayon 7
Fitzcarraldo wrote:Fully updated and upgraded to current packages in Entropy repository?

Yes
Fitzcarraldo wrote:Which version of kernel?

3.0.0
Fitzcarraldo wrote:Which desktop environment?

KDE
Fitzcarraldo wrote:32-bit or 64-bit version?

64bit
Fitzcarraldo wrote:Any error messages in /var/log/messages?

nope
the_gamer
Baby Hen
 
Posts: 2
Joined: Wed Jan 04, 2012 15:07

Re: Gateways won't work

Postby BHReach » Mon Jan 16, 2012 16:48

The network configuration file is /etc/conf.d/net.

Sample file is /etc/conf.d/network.

You can put conditionals in it like this (not sure of the syntax):

Code: Select all
ifup_eth0="gw 192.168.0.1"
ifdown_eth0="gw 192.168.0.5"


Be warned network managers will take over your /etc/conf.d/net file and change it. It is probably wise to disable that feature and manage the interfaces manually.

For NetworkMnanager, in /etc/NetworkManager/nm-system-settings.conf change

Code: Select all
managed=true


to

Code: Select all
managed=false


That will stop it from managing your interfaces, then put the configuration you want in /etc/conf.d/net.

Here is the Gentoo configuration manual:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4
BHReach
Growing Hen
 
Posts: 192
Joined: Thu Jan 31, 2008 20:40


Return to Networking and Wireless

Who is online

Users browsing this forum: No registered users and 1 guest