Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
02-19-2013, 11:38 AM
|
#1
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,906
Rep: 
|
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.
Last edited by Skaperen; 02-19-2013 at 11:39 AM.
|
|
|
02-19-2013, 12:12 PM
|
#2
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
02-19-2013, 02:45 PM
|
#3
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
02-19-2013, 02:48 PM
|
#4
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
02-19-2013, 02:49 PM
|
#5
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
02-19-2013, 03:20 PM
|
#6
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,906
Original Poster
Rep: 
|
Quote:
Originally Posted by Kustom42
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.
|
|
|
02-19-2013, 03:24 PM
|
#7
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
02-19-2013, 03:25 PM
|
#8
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,906
Original Poster
Rep: 
|
Quote:
Originally Posted by jefro
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.
|
|
|
02-19-2013, 03:30 PM
|
#9
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,906
Original Poster
Rep: 
|
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.
|
|
|
02-19-2013, 03:32 PM
|
#10
|
Member
Registered: May 2004
Location: India
Distribution: openSUSE Tumbleweed
Posts: 94
Rep: 
|
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)
|
|
1 members found this post helpful.
|
02-20-2013, 01:38 PM
|
#11
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,906
Original Poster
Rep: 
|
Quote:
Originally Posted by Kustom42
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.
|
|
|
02-20-2013, 01:43 PM
|
#12
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,906
Original Poster
Rep: 
|
Quote:
Originally Posted by pintooo15
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?
|
|
|
02-20-2013, 02:50 PM
|
#13
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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?
|
|
|
02-21-2013, 01:15 PM
|
#14
|
Member
Registered: May 2004
Location: India
Distribution: openSUSE Tumbleweed
Posts: 94
Rep: 
|
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 08:18 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|