LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-26-2008, 11:17 AM   #1
christyyim
Member
 
Registered: Oct 2008
Location: earth
Distribution: Ubuntu 'Gutsy Gibbon'
Posts: 32

Rep: Reputation: 15
How to detect whether I'm using Ethernet or wireless without NetworkManager?


If I now have both access to wired (Ethernet) and wireless networks, how I know which network I'm using currently without the help of NetworkManager (I had disabled the NetworkManager application). From where I can check it? Or which command I can used in terminal to know about it?

Thanks in advance
 
Old 12-26-2008, 11:31 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by christyyim View Post
If I now have both access to wired (Ethernet) and wireless networks, how I know which network I'm using currently without the help of NetworkManager (I had disabled the NetworkManager application). From where I can check it? Or which command I can used in terminal to know about it?

Thanks in advance
You can see how much traffic is going out a particular interface by doing:

Code:
/sbin/ifconfig
That will display something that looks similar to this, rx/tx packets and bytes show how much information is transferring through that particular interface since the last time it was reset:

Code:
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:xxx.xxx.xxx.xxx  Bcast:xxx.xxx.xxx.xxx  Mask:xxx.xxx.xxx.xxx
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6523320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6837132 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1427233631 (1.3 GiB)  TX bytes:1552357785 (1.4 GiB)
          Interrupt:11

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1189757 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1189757 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:695149212 (662.9 MiB)  TX bytes:695149212 (662.9 MiB)

You can check your routing priorities by running:

Code:
/sbin/route -nv
Which will result in an entry like this which shows what traffic is destined for what interface/route (this is an extremely simple entry):

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
xxx.xxx.xxx.xxx   0.0.0.0         xxx.xxx.xxx.xxx U     0      0        0 eth0
0.0.0.0         xxx.xxx.xxx.xxx    0.0.0.0         UG    0      0        0 eth0
In all likely hood if both the wireless and wired interfaces are on the same network you're using one exclusively unless you've configured it to do something else.

Last edited by rweaver; 12-26-2008 at 11:32 AM.
 
Old 12-26-2008, 11:33 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,017

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Try looking at the output of ifconfig
The interface that has an IP address is the one that is being used.

Note: you may encounter problems if you attempt to fire up both your wired and wireless interfaces (I certainly did).
 
Old 12-27-2008, 01:08 AM   #4
christyyim
Member
 
Registered: Oct 2008
Location: earth
Distribution: Ubuntu 'Gutsy Gibbon'
Posts: 32

Original Poster
Rep: Reputation: 15
sorry, rweaver, I cannot get what you mean, can you explain more on it? Here was what i get when i try /sbin/route -nv

Code:
christyyim@christyyim-laptop:~$ /sbin/route -nv
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
and tredegar, I have IP addresses for both interfaces when i try ifconfig
Code:
christyyim@christyyim-laptop:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1D:92:51:AF:27  
          inet addr:192.168.1.124  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21d:92ff:fe51:af27/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1475 errors:0 dropped:0 overruns:0 frame:0
          TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:515435 (503.3 KB)  TX bytes:22067 (21.5 KB)
          Interrupt:17 Base address:0x2000 

eth1      Link encap:Ethernet  HWaddr 00:1C:BF:98:B1:60  
          inet addr:192.168.1.8  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:bfff:fe98:b160/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4767 errors:0 dropped:583 overruns:0 frame:0
          TX packets:4800 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000 
          RX bytes:8109116 (7.7 MB)  TX bytes:1850199 (1.7 MB)
          Interrupt:18 Base address:0xe000 Memory:fdeff000-fdefffff
so any idea?
 
Old 12-27-2008, 02:57 AM   #5
baig
Member
 
Registered: Nov 2008
Location: وادی ھنزہ
Distribution: Solaris 5.10, Debian Server 5.2, CentOS 5.6
Posts: 226
Blog Entries: 3

Rep: Reputation: 38
What if I say.

ifconfig for wired Ethernet connections


and


iwconfig for wireless connections..


Code:
[root@wazirkutz ~]# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

eth0      no wireless extensions.

[root@wazirkutz ~]# 
Code:
ifconfig
eth0 Link encap:Ethernet HWaddr x:xx:xx:xxx:x:xx inet addr:x.x.x.x Bcast:x.x.x.x Mask:255.255.248.0 inet6 addr: fe80::21c:c0ff:fe80:dd9e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:183173 errors:0 dropped:0 overruns:0 frame:0 TX packets:6469 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:16028513 (15.2 MiB) TX bytes:1015460 (991.6 KiB) Interrupt:17 Base address:0x2000 eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx inet addr:192.xx.x.x Bcast:192.xx.xx.xx Mask:255.255.255.0 inet6 addr: fe80::2a0:ccff:fe20:af16/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:29 dropped:0 overruns:0 carrier:29 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:18 Base address:0xe000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3902 errors:0 dropped:0 overruns:0 frame:0 TX packets:3902 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:195036 (190.4 KiB) TX bytes:195036 (190.4 KiB)

Last edited by baig; 12-27-2008 at 04:14 AM.
 
Old 12-27-2008, 06:12 AM   #6
christyyim
Member
 
Registered: Oct 2008
Location: earth
Distribution: Ubuntu 'Gutsy Gibbon'
Posts: 32

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by baig View Post
What if I say.

ifconfig for wired Ethernet connections


and


iwconfig for wireless connections..


Code:
[root@wazirkutz ~]# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

eth0      no wireless extensions.

[root@wazirkutz ~]# 
Code:
ifconfig
eth0 Link encap:Ethernet HWaddr x:xx:xx:xxx:x:xx inet addr:x.x.x.x Bcast:x.x.x.x Mask:255.255.248.0 inet6 addr: fe80::21c:c0ff:fe80:dd9e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:183173 errors:0 dropped:0 overruns:0 frame:0 TX packets:6469 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:16028513 (15.2 MiB) TX bytes:1015460 (991.6 KiB) Interrupt:17 Base address:0x2000 eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx inet addr:192.xx.x.x Bcast:192.xx.xx.xx Mask:255.255.255.0 inet6 addr: fe80::2a0:ccff:fe20:af16/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:29 dropped:0 overruns:0 carrier:29 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:18 Base address:0xe000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3902 errors:0 dropped:0 overruns:0 frame:0 TX packets:3902 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:195036 (190.4 KiB) TX bytes:195036 (190.4 KiB)
Sorry, can you explain more in detail? I not really understand. Thanks.
 
Old 12-27-2008, 06:43 AM   #7
christyyim
Member
 
Registered: Oct 2008
Location: earth
Distribution: Ubuntu 'Gutsy Gibbon'
Posts: 32

Original Poster
Rep: Reputation: 15
And I can get both IP addresses for both networks with my NetworkManager disabled.

Last edited by christyyim; 12-27-2008 at 06:50 AM.
 
  


Reply


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
sony ericsson (usb0) suddenly stops working with networkmanager ethernet usb netsurf Fedora 2 04-03-2008 09:44 PM
Wireless configuration NetworkManager for Etch swampdog2002 Debian 5 03-28-2008 05:06 PM
Wireless card not recognized? just enabled NetworkManager - need help! ccfc1986 Linux - Laptop and Netbook 8 02-18-2008 03:44 PM
NetworkManager can't connect to wireless networks debeus Linux - Laptop and Netbook 3 12-26-2007 07:39 PM
NetworkManager shutting down wireless mickeyboa Fedora 2 04-24-2005 07:30 PM


All times are GMT -5. The time now is 12:13 AM.

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