On Monday, March 28, 2011 07:28:51 am Don Raboud wrote: < big snip >
I'll report back anything I find out.
I'll add comments to various bits below, pulled from both this message and others in the thread. I want to thank Giacomo for providing the correct method. On Monday, March 28, 2011 06:28:33 am Don Raboud wrote:
In the meantime, I think I have found a workaround. Network Manager calls dhcpclient when an automatic connection needs to be made. So I edited /etc/dhclient.conf by adding the following lines to the end of the default supplied file
interface "eth0" { fixed-address 192.168.1.65; }
so that dhclient will request this specific IP address.
The correct syntax should be alias { iterface "eth0"; fixed-address 192.168.1.65; option subnet-mask 255.255.255.0; } added to the end of /etc/dhclient.conf. This works from the command line (when Networkmanager is disabled), # /sbin/dhclient eth0 giving both address as expected. However, this does not work with NetworkManager. Only the automatic address is returned. Not sure why. On Monday, March 28, 2011 08:33:32 am Giacomo Comes wrote:
I had the same problem some time ago (it was with opensuse 11.1) and I didn't find any solution already available. Therefore I created my own.
Step one: create the executable script
< snip> This works very well for me here. I note that the name of the script is unimportant. All scritps in /etc/NetworkManager/dispatcher.d seem to get called when an interface goes up or down. Some of these call other scripts in /etc/sysconfig/network/if-{*}.d/ so there may be other opportunity for hooking in for specific cases. One small comment about the script. I replaced /sbin/ifconfig $1:1 ${IPROUTER%.*}.$MYIP with /sbin/ip addr add ${IPROUTER%.*}.$MYIP/24 dev $1 since my understanding is that ifconfig is obsolete (but dying a long slow death) and ip should be used instead. Both seem to work here. Actually, in my simple case (one router, one wired connection), the following script is an (almost, see below) sufficient replacement for Giacomo's script: ------------------------------------------- #!/bin/bash [[ $1 = eth0 && $2 = up ]] && /sbin/ip addr add 192.168.1.65/24 dev eth0 ------------------------------------------
One problem that I have found with this solution is that from time to time the fixed ip address disappear. I never had enough time to investigate the cause, but I have implemented a workaround.
< snip > I've found that later when a VPN connection is made the fixed address remains, but when the VPN connection is subsequently closed, NetworkManager gets rid of the fixed address. To workaround this, I changed the simple script above to ------------------------------------------- #!/bin/bash [[ $1 = eth0 && $2 = up ]] && /sbin/ip addr add 192.168.1.65/24 dev eth0 [[ $1 = tun0 && $2 = vpn-down ]] && /sbin/ip addr add 192.168.1.65/24 dev eth0 ------------------------------------------ This is a dumb script, but seems to work for my simple case. If there are problems there is still Giacomo's workaround, which I haven't tried yet. Again, big thanks to Giacomo for showing the way to fix this! -- Don -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kde+help@opensuse.org