View Single Post
Old 11-22-2011, 03:37 PM   #10
ryran
Connoisseur
ryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with others
 
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
Lightbulb

idollar's got a good point. If you're using a distro with NM, you DEFINITELY need to give IT some love before you go messing around with ifconfig. I'm surprised more people haven't posted about this issue, actually... For normal people with one kindle, all you have to do is configure the kindle in NetworkManager to have a static address. As a plus, then you won't have to mess with ifconfig anymore.

For geekmaster:
When you initially plug one of the kindles into your ubuntu box (without using your special script), nm-applet starts flashing or morphing or rotating (in this case, showing that it's trying to negotiate dhcp), right? If so, the following might come in handy for you.. you could add it to the little script you've got going on. It tells NM to stop managing that interface and then you'll be free to do your own magic with ip or ifconfig or whatever.

Code:
for USB in $(nmcli dev | awk '/usb.*connecting/{print$1}'); do
    nmcli dev disconnect iface $USB
done
PS: Don't need to be root for that.
PPS: To be clear, nmcli dev disconnect only tells NM to stop messing with your if.. until the next time the device is unplugged and plugged back in.

Last edited by ryran; 11-22-2011 at 03:44 PM. Reason: Made code simpler
ryran is offline   Reply With Quote