LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-19-2013, 11:38 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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.
 
Old 02-19-2013, 12:12 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 02-19-2013, 02:45 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
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.
 
Old 02-19-2013, 02:48 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 02-19-2013, 02:49 PM   #5
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 02-19-2013, 03:20 PM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Kustom42 View Post
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.
 
Old 02-19-2013, 03:24 PM   #7
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 02-19-2013, 03:25 PM   #8
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jefro View Post
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.
 
Old 02-19-2013, 03:30 PM   #9
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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.
 
Old 02-19-2013, 03:32 PM   #10
pintooo15
Member
 
Registered: May 2004
Location: India
Distribution: openSUSE Tumbleweed
Posts: 94

Rep: Reputation: Disabled
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.
Old 02-20-2013, 01:38 PM   #11
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Kustom42 View Post
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.
 
Old 02-20-2013, 01:43 PM   #12
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by pintooo15 View Post
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?
 
Old 02-20-2013, 02:50 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
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?
 
Old 02-21-2013, 01:15 PM   #14
pintooo15
Member
 
Registered: May 2004
Location: India
Distribution: openSUSE Tumbleweed
Posts: 94

Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Used wired to install now on wireless but system waits for wired dhcpoffer. lonniec Linux - Laptop and Netbook 3 03-08-2011 07:52 PM
bridging a wireless and wired network causes wired to stop working royce2020 Linux - Networking 0 04-21-2009 04:48 PM
netgear ma311 wireless card will not talk to actiontec wired/wireless router tzonga1 Linux - Wireless Networking 2 02-10-2007 05:52 PM
Wireless Laptop to Wired ethernet via Linux PC (wired/wireless) sambartle Linux - Wireless Networking 0 01-30-2005 04:37 AM
Wired to Wireless back to Wired The_Nerd Linux - Hardware 5 09-15-2004 09:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration