0
ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT 
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 500
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

how do perform a check which network interface is active and providing internet and internet is working on that interface. In the above lo(loopback interface),eno1(ethernet interface),wlp2s0(wireless) are up but i am getting internet only from wlp2s0.

3

One fairly good way is to check the routing table to see where the default routing goes

ip route list | grep default
1

how do perform a check which network interface is active

Any of the interfaces saying state UP are active, and providing connectivity to some network or another.

and providing internet and internet is working on that interface.

You are really asking about just how approximately does ip routing work, and there is a lot of depth to that question. In essence, the routing table is a list of different networks with masks, and what network interface or external router provides connectivity to them.

At the end of this list is a special entry called the default route, which is kind of an alias for the network 0.0.0.0/0. It functions as a catch-all for things that you have no specific entry for, and in essence is the internet.

You can see the routing table by typing ip route. It will provide some explanation of what interfaces are used for different addresses, and show the mighty default route.

-1

simply type route. It should give you the active Net providing interface's details.

  • Well, my bad I am supposed to explain. cause above command's outputs have to be checked with another command. Anyway, simply type route. It should provide you the details of ip and interface. – user2607919 Apr 22 '16 at 4:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.