Results 1 to 5 of 5

Thread: How can I tell WHICH connection Ubuntu is actually using? (wlan0, wlan1, eth0, etc.)

  1. #1
    Join Date
    Aug 2010
    Beans
    407
    Distro
    Ubuntu 10.04 Lucid Lynx

    How can I tell WHICH connection Ubuntu is actually using? (wlan0, wlan1, eth0, etc.)

    How can I tell WHICH connection Ubuntu is actually using?

    Googling, some suggest I use the "route" command (but I'm not sure what it's actually telling me about which connection (wlan0, wlan1, eth0, etc.) Ubuntu is actually using.
    Code:
    $ route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
    10.20.30.0      *               255.255.255.0   U     2      0        0 wlan0
    link-local      *               255.255.0.0     U     1000   0        0 wlan0
    default         10.20.30.40     0.0.0.0         UG    0      0        0 wlan0
    Others say to use the "arp" command (again, I'm not sure what it's telling me).

    Code:
    $ arp
    Address                  HWtype  HWaddress           Flags Mask            Iface
    192.168.0.18             ether   00:14:d1:22:a3:93   C                     eth0
    10.20.30.40              ether   00:16:b6:23:4f:96   C                     wlan0
    192.168.0.54             ether   00:27:22:3e:ff:23   C                     eth0
    192.168.0.20             ether   00:26:82:25:2a:16   C                     eth0
    May I ask what command tells me, beforehand, which network interface Ubuntu will use?

  2. #2
    Join Date
    Mar 2012
    Beans
    23

    Re: How can I tell WHICH connection Ubuntu is actually using? (wlan0, wlan1, eth0, et

    you could for example in one shell get a ping going for google.com and then tcpdump -i eth0|grep google.com

    and then see what you can pickup, basically use tcpdump if you don't want to use a graphical monitoring tool.

    you can also just use netstat or something, for what reason and/or why are you looking for this?

  3. #3
    Join Date
    Aug 2010
    Beans
    407
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How can I tell WHICH connection Ubuntu is actually using? (wlan0, wlan1, eth0, et

    Quote Originally Posted by jaybutts View Post
    why are you looking for this?
    Good question.

    I have multiple ISP providers, all WISP (three to be exact) that I'm testing out performance of at the same time.

    All of this is being done with temporary setups, e.g., this is outside pointing at one of them.


    In my comparisons, I have all three running at the same time because it's a royal pain to disconnect one set and then reconnect them up again.

    So, with all three 'available', I simply need to know which one is being used at any one moment for my test purposes.
    Attached Images Attached Images

  4. #4
    Join Date
    Apr 2011
    Beans
    35

    Re: How can I tell WHICH connection Ubuntu is actually using? (wlan0, wlan1, eth0, et

    By using
    Code:
    route -n
    command you can always see through what IP number, internet goes. In your case it is wlan 10.20.30.40 you have flag UG.

    You can always change that by giving another route to differnt ISP
    deleting old route
    Code:
    route del default gw y.y.y.y wlan0
    and adding new
    Code:
    route add default gw x.x.x.x eth0
    I am using that I have 2 ISPs

  5. #5
    Join Date
    Aug 2010
    Beans
    407
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How can I tell WHICH connection Ubuntu is actually using? (wlan0, wlan1, eth0, et

    Quote Originally Posted by rmil View Post
    By using "route -n", you can always see through what IP number, internet goes. In your case it is wlan 10.20.30.40 you have flag UG
    How does this look for a plan to follow what you just said to do?
    Code:
    $ ifconfig
    Reveals ... 
    wlan0 ==> inet addr:10.20.30.159  Bcast:10.20.30.255  Mask:255.255.255.0
    eth0 ==> inet addr:192.168.0.200  Bcast:192.168.0.255  Mask:255.255.255.0
    Running the suggested command:
    Code:
    $ route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    10.20.30.0      0.0.0.0         255.255.255.0   U     2      0        0 wlan0
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
    0.0.0.0         10.20.30.40     0.0.0.0         UG    0      0        0 wlan0
    And, adding anything of value from the route command:
    Code:
    $ route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
    10.20.30.0      *               255.255.255.0   U     2      0        0 wlan0
    link-local      *               255.255.0.0     U     1000   0        0 wlan0
    default         10.20.30.40     0.0.0.0         UG    0      0        0 wlan0
    Then, to change it, you suggest I go from:
    Code:
    $ sudo route del default gw 10.20.30.40 wlan0
    To what IP address?

    Do I pick the IP address of the radio (which is currently set up as a bridge?)
    Code:
    $ sudo route add default gw 192.168.0.100 eth0
    
    Unfortunately, this results in the error:
     SIOCADDRT: No such process
    So, I think I'm close to being able to switch, at will, between eth0 and wlan0 (if it weren't for that error above).

    Maybe I put the wrong IP address in the "route add" line?
    How do I get that IP address to set to the default for eth0?
    Is it the gateway IP address of the WISP radio which is connected to the laptop eth0 port?
    Or, do I use the gateway IP address as set up in that WISP radio?
    Last edited by rocksockdoc; March 28th, 2012 at 11:21 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •