In our office we have both LAN and Wi-Fi network. say i have now connected to both LAN and WiFi. now when i give ipconfig. It is showing both LAN IP and also WiFi IP. I want to know, to which network i'm really connected. The 'Network connections icon' on laptop is showing that i'm connected to WiFi, when i have both WiFi and LAN connection. But if i remove LAN connection.. My network is getting interrupted and taking time to connect to WiFi again.

How to find to which network i'm really connected??


You are connected to both. What you are really asking (I think) is which connection am I using to send data. This is shown from the routing table.

For example:

[dave@rclogin ~]$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth0     U     0      0        0 eth0         UG    0      0        0 eth0

Shows the current routes, in my case everything goes to eth0.

Routing works from top-to-bottom so for example if I had:  U  0  0  0 eth0  U  0  0  0 wlan0

Then it would use eth0 as a route was found before wlan0 was reached.

The reason I think you are getting connectivity problems when disconnecting is perhaps caused by both interfaces sharing the same IP range (which I'm guessing is the case?), so connections to that network are being torn down before being re-established.

| improve this answer | |
  • These are my Ips >> LAN - || WIFI - – asura Mar 12 '13 at 13:31
  • ' so connections to that network are being torn down before being re-established.' can u explain this statement in detail ? – asura Mar 12 '13 at 14:01
  • I did say "think" at the start of that sentence, I would need to model it properly to be certain. However when you have two interfaces that have exactly the same network/routing information things can easily get confused when routing is being updated (such as a link being removed). You mentioned your Wifi reconnecting - is this actually the case e.g. do you see the wireless interface loose connection and then re-negotiate with the base station, or rather do you just see interruption to data? If just interruption I think the network+default routes are being removed and need re-created. – Dave Mar 12 '13 at 16:50
  • i can see my Wi-Fi is getting disconnected. (losing connection) – asura Mar 13 '13 at 10:17

Run a tracert to an external source, like, and find out which gateway it is leaving out of. This can verify if it left via your LAN address or your WiFi address (unless they are on the same subnet, in which case it wouldn't matter :) )

| improve this answer | |

Run the ip route print command. It will show you the routing table of your computer. You will be able to find the networks that you are connected to and the default gateway then. It should reveal you what you want to know.

| improve this answer | |

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