LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices

Reply
 
Search this Thread
Old 10-05-2006, 04:20 AM   #1
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Rep: Reputation: 0
switch between wired/wireless


Hi,all
I am a newbie here, glad that I found this place
I have a question that in case I have a device (say LAN IP 192.168.0.10) which is switching between wired and wireless network. The switching is good and getting the wireless IP from AP perfectly.
The question is, how come I can still ping/access the old wired IP after the device is using it's new IP from wireless AP? On the device, the ethernet interface changes from eth0 to rausb0, but if I do "ifconfig eth0 up", the IP of eth0 is still the old one! I think it should be "cleared" after network switching... Is that the problem of the network device driver cache was not refreshed?
thanks for any advices.

regards,
hsupoyang
 
Old 10-05-2006, 06:32 AM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
I do "ifconfig eth0 up", the IP of eth0 is still the old one! I think it should be "cleared" after network switching... Is that the problem of the network device driver cache was not refreshed?
you shouldn't use ifup since the interface is up, it is true linux won't set your eth0 ip to 0.0.0.0 once you disconnect the network cable

If you feel not confortable with this simply make a script to bring down eth0 with 'ifdown eth0' during wireless on.
 
Old 10-05-2006, 07:16 AM   #3
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kstan
I do "ifconfig eth0 up", the IP of eth0 is still the old one! I think it should be "cleared" after network switching... Is that the problem of the network device driver cache was not refreshed?
you shouldn't use ifup since the interface is up, it is true linux won't set your eth0 ip to 0.0.0.0 once you disconnect the network cable

If you feel not confortable with this simply make a script to bring down eth0 with 'ifdown eth0' during wireless on.
thanks kstan,
I use "ifconfig eth0 up" just want to see if the IP of the eth0 interface changes, but apparently not.
This happends when I try to switch network connection from LAN(e.g. 192.168.0.10) to WLAN (e.g. 19.168.0.x), the WLAN happens to use the same segment "0" (but not the same segment in fact), so I found that the old LAN IP still works and start to trace what happens.
So, does it because the eth0 device driver or kernel keep the old IP information and not to clean it?

hsupoyang
 
Old 10-05-2006, 02:22 PM   #4
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
If all you're doing is switching from one interface to another to access data then the previous interface hasn't changed. It won't change unless it's instructed to do so either by the os or by you.

Like kstan mentioned, when just checking the status of an interface simply use ifconfig eth0 or just ifconfig. There's no need to use up, but if you want to switch one off use down. i.e. ifconfig eth0 down.

Quote:
the WLAN happens to use the same segment "0" (but not the same segment in fact)
What do you mean by this? It looks as though their both on the same "segment". Do they also have the same netmask? i.e. 255.255.255.0 That could cause issues if they're both "up". If they're not the same "segment" or netmask then your wired/wireless access points should have appropriate addresses/netmasks as well.
 
Old 10-05-2006, 07:17 PM   #5
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
in tcp/ip don't care how many interface you facc, as long as your interface is join into a network and the network have a dhcp server, then the interface will get an ip (unless you use static ip).

To check your interface status(have link or not), simply type 'sudo mii-tool' or 'mii-<tab><tab>' to see available option (depends distro).

Ks
 
Old 10-08-2006, 09:42 PM   #6
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dracolich
If all you're doing is switching from one interface to another to access data then the previous interface hasn't changed. It won't change unless it's instructed to do so either by the os or by you.

Like kstan mentioned, when just checking the status of an interface simply use ifconfig eth0 or just ifconfig. There's no need to use up, but if you want to switch one off use down. i.e. ifconfig eth0 down.



What do you mean by this? It looks as though their both on the same "segment". Do they also have the same netmask? i.e. 255.255.255.0 That could cause issues if they're both "up". If they're not the same "segment" or netmask then your wired/wireless access points should have appropriate addresses/netmasks as well.
Thanks for your kindly answer,
The whole story is, I am tesing my device between wired and wireless environment. At first I am in the LAN environment which IP is 192.168.0.10, and then I set up the wireless access point and switch my device to using WLAN which getting its IP via DHCP on wireless AP, the result is 192.168.0.7 (it happens to have the same third digit in their IP address, but they are surely not the same segment and should not connect to each other).
And then I unplugged the LAN and type the old IP (192.168.0.10, I should type 192.168.0.7 but just typo, so the question arises...:P) to use the web interface of the device (in theory, the old LAN IP address should be not accessable after I switch to WLAN without problem, but amazingly, I can still access the web interface (or ping) via old LAN IP address...

I did know that to check the status of ethernet interface is just using "ifconfig" (and the result is ok, there are only interfaces "lo" and "rausb0" without "eth0"), but I just want to know why the old LAN IP address "remains" in the interface which was not used anymore and not been cleared once it was "down", that's the reason why I "ifconfig eth0 up" to see what happened in the eth0 interface.

Thanks for your kindly answers, now I know that's the responsibility of kernel or user to do so...

Last edited by hsupoyang; 10-08-2006 at 09:47 PM.
 
Old 10-09-2006, 03:31 PM   #7
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
I should've asked this before, is the AP a wireless router like Netgear or D-Link that allows both connections? That would be why the addresses are working the way they are. The router uses just one address so it doesn't matter wether the host connects via wired or wireless. Tat's why when you get an address via DHCP the first three octets are the same as what you had when wired. It might be configurable in the router's setup and that might depend on the router.
 
Old 10-10-2006, 09:38 PM   #8
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dracolich
I should've asked this before, is the AP a wireless router like Netgear or D-Link that allows both connections? That would be why the addresses are working the way they are. The router uses just one address so it doesn't matter wether the host connects via wired or wireless. Tat's why when you get an address via DHCP the first three octets are the same as what you had when wired. It might be configurable in the router's setup and that might depend on the router.
dear dracolich,
thanks for your post and yes, the AP is a wireless router but does not allow both connections. The addresses are working the way they are because I didn't do the "clear" previous IP address on the previous unused interface. The reason why the first three octets are the same is just by accident and hence my question pops up but everything is ok so far, thanks all again.
 
  


Reply

Tags
cache, device, driver, network


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
cheap switch with 24 or 48 ports plus 2 Gb wired with SNMP narmida Linux - Networking 5 03-03-2006 05:17 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
Switch wireless and wired NIC names sharpie Linux - Wireless Networking 0 09-12-2004 03:18 AM
Do you need to switch between wireless and wired interfaces? Wanna monitor cpufreq? ming0 Linux - Laptop and Netbook 0 01-31-2004 02:06 AM


All times are GMT -5. The time now is 01:38 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration