Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'd like to have this completely automated for a laptop. When the laptop is plugged in to the ethernet wired LAN, it automatically uses that. When it is unplugged, it uses the wireless. AND do it on the same IP address ... so various connections and such are not broken.
What particular things are needed to do this with no human user intervention needed?
FYI: If I designed how all the networking worked, this would be easy. But that's just not the way it is.
Not possible. Mac addresses will change and the router will not be able to assign the same IP automatically. The system should fail over to your wireless automatically and get an IP from the router via DHCP.
Now, what you could do is some MAC address spoofing and use routing to jump the connections to a different IP but that is a pretty big pain unless you really need it. Do you have a specific need to maintain the same internal IP for two different connections? I can't imagine you would but give us some better info.
You could create a script that does it I suspect. Might ask others for how to make a script that uses hardware tests and then configs it. I assume you mean that you only want one connection available at a time when only that connection is available. Otherwise you'd have to set a priority as to which to configure.
What about bonding the interfaces into active/passive mode? That should work for this, without having to spoof the MAC so the router keeps the same DHCP assignments.
http://r.outlyer.net/linux:bonding should work for you. Don't know why I didnt think of this first, the MAC addresses held me up but with a bond your router should only see the one interface.
Not possible. Mac addresses will change and the router will not be able to assign the same IP automatically. The system should fail over to your wireless automatically and get an IP from the router via DHCP.
Now, what you could do is some MAC address spoofing and use routing to jump the connections to a different IP but that is a pretty big pain unless you really need it. Do you have a specific need to maintain the same internal IP for two different connections? I can't imagine you would but give us some better info.
I understand this in the normal case. But in this day of "network manager" software, we should be able to do something more, like arrange to use the same IP address and update the ARP table.
The IP isn't addressed on your system it's addressed by your DHCP service. If the DHCP service gets a new arp/mac it will assign a new IP via DHCP. The only way to do it is with bonding so that the DHCP service does not see any change.
You could create a script that does it I suspect. Might ask others for how to make a script that uses hardware tests and then configs it. I assume you mean that you only want one connection available at a time when only that connection is available. Otherwise you'd have to set a priority as to which to configure.
One at a time is sufficient. The ether connection would be priority for most cases.
I'd like to see the router add more smarts where something can tell it that these two MACs are the same machine, and thus anything from either is good enough for receiving from that machine, AND that receipt provides a hint as to which is likely the working interface when one goes down. That could be, for example, told to it in the DHCP config (extended feature). Dynamic would be nice, but that needs some new protocol.
One idea I was thinking, instead of altering the logic of things that are implemented and deployed now, is to make this go through tunnels that end up on some box. I'd have to modify the tunnel software so it know each tunnel is a way to get to that one laptop ... use whatever works.
OP, coincidentally my friend has written a simplified howto for this exact scenario and yes it does involve the bonding module and eth0 and wlan0 in active-backup mode. http://kingsly.net/tmp/bonding-howto.txt
HTH
p.s. any way to refer to a username such that it automatically points to his/her profile page? (twitter mention habit)
The IP isn't addressed on your system it's addressed by your DHCP service. If the DHCP service gets a new arp/mac it will assign a new IP via DHCP. The only way to do it is with bonding so that the DHCP service does not see any change.
In my case, switching to static IP addressing is an option.
OP, coincidentally my friend has written a simplified howto for this exact scenario and yes it does involve the bonding module and eth0 and wlan0 in active-backup mode. http://kingsly.net/tmp/bonding-howto.txt
HTH
p.s. any way to refer to a username such that it automatically points to his/her profile page? (twitter mention habit)
My topology may not work with this. The access point router is located by the cable modem in a location apart from everything else. A wireless bridge is connected to the LAN. The ethernet that would plug in the laptop is on the switch for the LAN, not the access point router. Can the bonding still work on that?
As long as both the wired and wireless links use the same dhcp server/network range it will be a seamless transition with no TCP connections dropped. Or else, it will require a new DHCP lease.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.