Is there a way to know what connection I'm using?

5,594

Solution 1

If you have more than one network connection active at one time (each one with its IP address), it is the routing table that should determine which one is used for a particular request.

If you are using Network Manager, the command

nm-tool | grep -i 'device\|state'

should give you information about the active connection, and the output of route should give you information about which interface is used to reach a particular IP address.

Given your routing table, both interfaces have the same route, but eth0 is preferred because of a minor metric.

The conclusion should be that you are only using eth0, this can be verified with ifconfig, look at the Byte RX and Byte TX fields.

Solution 2

If you look in ifconfig when you are connected to both connections. notice the dominating connection since it has a much greater number of packages received and a lot more data received.

Share:
5,594

Related videos on Youtube

Alvar
Author by

Alvar

Updated on September 18, 2022

Comments

  • Alvar
    Alvar almost 2 years

    The reason I ask is because I want to know if I will achive higher speeds if I'm connected to both than just one connection. Also when I'm gaming (on the internet) if I just use the wireless I always drop out after a while, but I don't if I use both!

    I'm connected to both the wireless and the wired connection.

    • How can I know what connection I'm using?
    • Am I using both at the same time?
    • Which one is the one I get my IP-address from?

    This was an interesting result of nm-tool | route

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     *               255.255.255.0   U     1      0        0 eth0
    192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0
    

    I want to know where the "main" amount of packages are sent. So if I'm connected to both I would like to know which one has the most weight put on it?

    The router is a D-link 524.

    • Sanam Patel
      Sanam Patel over 12 years
      Can you log in to the router and see which way it reports your machine is connected? This might be the simplest way.
    • Alvar
      Alvar over 12 years
      @TomBrossman I'm connected to both connections, that's my problem. It only list information about a IP-address and not if it's wireless or wired connection.
    • Sanam Patel
      Sanam Patel over 12 years
      You won't have a faster connection with both, you still can't exceed the router's connection out on to the Internet and you likely only have one network card anyway. If it's practical, always choose Ethernet over WiFi to minimize latency. Test for yourself with a traceroute or ping the router in Network Tools.
  • Alvar
    Alvar over 12 years
    edited my question with route command you suggested.
  • enzotib
    enzotib over 12 years
    @Alvar: edited my answer.