Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How to know which network is connected?

Writer Sophia Terry

How can I see using command-line whether I am connected to network using eth0, eth1 or wln0 etc?

Well, to elaborate, I have a desktop sidebar which I installed using program "conky". This sidebar has meter that shows internet speed. Since I am not using eth0, I need to make a minor change in ~/.conkyrc file. I need to replace "eth0" with whatever network is being used by my wireless card to connect to internet (via a router).

1

1 Answer

You may very well be connected to multiple networks at once, depending on your setup.

If you are interested in knowing which interface is being used for Internet traffic, try using the ip route command and look at the default route. For example, on my system it shows that traffic will travel over eth0 if it isn't matched by any of the other rules in the table:

$ ip route
default via 192.168.0.1 dev eth0 proto static
169.254.0.0/16 dev eth0 scope link metric 1000
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.10 metric 1 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy