Re: Three Questions, Same SSID, Dispatch hooks with Full info, Connection Priorities



On Fri, 2012-12-07 at 14:50 +0200, Mark Elkins wrote:
> Hi, I have several questions regarding NetworkManager.
> I'm using net-misc/networkmanager-0.9.4.0-r6  USE="avahi bluetooth
> dhcpcd gnutls introspection modemmanager ppp wext -connection-sharing
> -dhclient -doc -nss -resolvconf -wimax"   (Gentoo-3.5.3, without
> '~amd64', on a 64-bit Dell XPS Laptop)
> 
> The wireless card is (from 'lshw' command)
> 
>   product: Centrino Wireless-N 1030 [Rainbow Peak]
>   vendor: Intel Corporation
>   capabilities: pm msi pciexpress bus_master cap_list ethernet physical
> wireless
>   configuration: broadcast=yes driver=iwlwifi driverversion=3.5.3-gentoo
> firmware=17.168.5.2 build 35905 ip=160.124.48.9 latency=0 link=yes
> multicast=yes wireless=IEEE 802.11bgn
> 
> Everything more or less works fine, much better than when I was just
> running wpa_supplicant with its own Gnome-2 GTK gui-interface.
> There are some Gotcha's though.
> 
> 1 - WPA-Supplicant would show all access points, giving SSID, Channel
> (1-14), strength (just not BSSID). I found this behaviour *very* useful.
> One had the opportunity to either have the same settings (PassPrase,
> etc) for all AP's with the same SSID, or a setting per BSSID. I have
> three different AP's at home, same SSID & PassPhrase. I still like to
> choose which one I connect to, or if one is missing, clue as to which
> one it i.

NM supports "locking" a connection to a specific BSSID, which you do via
the "BSSID" entry in nm-connection-editor.  So you'd create three
different connections, each named something different (My SSID 1, My
SSID 2, etc), but set them all to the same SSID and passphrase, but lock
each one to it's specific BSSID.

> $ nmcli dev wifi  - will give me the info (except Frequency rather than
> channel No.) but I'd like to see that in the GUI.
> The ability to immediately 'see' was very useful at the last IGF meeting
> in Baku, I could see that the conference SSID was on the same channel at
> about the same strength - so I could see there was going to be an
> interference problem. (The 2.4 Wifi issues in Baku is another story!)

It might be reasonable to show this in nm-applet's "Connection
information" menu (patches accepted), but it's unlikely we'll ever show
it in the actual dropdown menu scan list for space reasons.

> 2a - I was using a Hook in dhcpcd to send back a secured nsupdate of my
> current IPv4 address. I've moved this code into
> '/etc/NetworkManager/dispatcher.d'. Ethernet connections work fine but
> wireless connections often do not have all the IPv4 variables set. I
> think its because DHCPCD has not yet got an IP address. How do I get a
> trigger sent to me after DHCP has finished?
> IPv6: I use RA's. No dhcpv6 server yet. My Kernel also creates a random
> IPv6 address for my laptop. I'd love for all IPv6 addresses to be
> available as Variables so I can do some DHCP Hook magic.

NetworkManager runs both in parallel, and the first one that finishes
"wins" and the NetworkManager says it's online.  It does this so that
you don't block for 2 minutes or more waiting for an RA that will never
come if the network isn't IPv6 enabled.  In your case, IPv6 finishes
first, but you should be able to use the "dhcp4-change" event to get the
updated DHCP4 info.  If that doesn't happen, then we should fix that.
Even better, we should have an ip4-change/ip6-change event which handles
these.

> 2b - I have a 'dispatcher' script to re-write my resolv.conf:
>    cat /etc/resolv.conf{.head,,.tail} 2>/dev/null > /etc/resolv.conf.tmp
>    mv -f /etc/resolv.conf.tmp /etc/resolv.conf
> This also doesn't work as expected. It seems NetworkManager re-writes
> 'resolv.conf' once again after dhcpcd has done its work, after
> dispatcher has run.

What are you trying to add to resolv.conf?  If you're trying to do local
caching nameserver, NetworkManager has that functionality built-in via
dnsmasq, including the ability to add custom dnsmasq configuration.  If
you're trying to add search domains, you could add this via "prepend"
functionality to dhclient config files which get picked up by NM too.

There is a need for more flexible DNS configuration though, and there
we've got some plans there.

> 3 - Network Device priorities: in my 'NetBook', I have a GSM/3G sim
> card. I'd like it that if I'm out of Access point coverage, the 3G
> works, but once in 'known' AP range, 3G is switched off and WiFi runs,
> and if I plug into a wired Ethernet, that takes over. I've been caught
> more than once that when plugged in to Ethernet, data (a large, multi
> Gig file for entertainment purposes) was being copied over the Wifi over
> IPv6, where as I had my (dhcp-assigned) IPv4 (& IPv6) address on my
> Ethernet.
> The old WPA-Supplicant worked 'fine', ie switch off the Wifi when
> plugged into the Ethernet.

Not sure how that happened, since the supplicant doesn't do anything
with wired.  What likely happened here was that dhclient-script rewrote
your default route to point to wired whenever it got a least.  The
problem is that in this scenario, you'd have two dhclients runing, one
for ethernet and one for wifi, and whenever a renew happens, each one
ovewrites the other one.  Unless you have something like resolvconf
enabled, in which case I'd assume you have priority rules for eth* and
wlan*.

In any case, this isn't possible with NetworkManager, though you can
emulate it through the use of dispatcher scripts.  For example, when
NetworkManager signals that eth0 is "up", you could use 'nmcli nm wifi
off' to kill wifi entirely.  When NM signals that eth0 is "down", you
can 'nmcli nm wifi on' to turn it back on.  Same goes for wlan0 up/down.
This doesn't cover all cases, but quite a few of them.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]