LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Wired and wireless on the same IP (http://www.linuxquestions.org/questions/linux-networking-3/wired-and-wireless-on-the-same-ip-4175450816/)

Skaperen 02-19-2013 11:38 AM

Wired and wireless on the same IP
 
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.

Kustom42 02-19-2013 12:12 PM

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.

jefro 02-19-2013 02:45 PM

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.

Kustom42 02-19-2013 02:48 PM

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.

Kustom42 02-19-2013 02:49 PM

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.

Skaperen 02-19-2013 03:20 PM

Quote:

Originally Posted by Kustom42 (Post 4895274)
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.

Kustom42 02-19-2013 03:24 PM

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.

Skaperen 02-19-2013 03:25 PM

Quote:

Originally Posted by jefro (Post 4895404)
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.

Skaperen 02-19-2013 03:30 PM

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.

pintooo15 02-19-2013 03:32 PM

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)

Skaperen 02-20-2013 01:38 PM

Quote:

Originally Posted by Kustom42 (Post 4895444)
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.

Skaperen 02-20-2013 01:43 PM

Quote:

Originally Posted by pintooo15 (Post 4895453)
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?

jefro 02-20-2013 02:50 PM

Wonder about an alias on each one to match what you want.


Wouldn't it be easier to set static IP's for these two?

pintooo15 02-21-2013 01:15 PM

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.


All times are GMT -5. The time now is 03:10 AM.