Find the answer to your Linux question:
Results 1 to 4 of 4
I need help configuring the two network interfaces on my computer. My Intel-based computer running Ubuntu 12.04 LTS has a wired ethernet port (eth0) and a wireless interface (wlan0). A ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    2

    managing ip traffic across two network interfaces


    I need help configuring the two network interfaces on my computer.

    My Intel-based computer running Ubuntu 12.04 LTS has a wired ethernet port (eth0) and a wireless interface (wlan0).

    A local access point is connected to the wired interface. This access point is configured with a DHCP server to provide a static (reserved) address to the computer. Thus, the computer can be accessed with a fixed IP address by a browser through the access point. This works for me.

    I'd like to use the wired interface (and access point) only to respond to requests coming from the access point. The local access point is not connected to the internet. It is simply an inbound wifi gateway to my computer.

    The wireless interface on my computer connects to the Internet through a company-provided access point. It cannot have a fixed IP address. I do not control the access points to which this wireless interface connects.

    My problem is that internet connection requests from programs on my computer seem to get routed to the wired interface (which doesn't go anywhere) instead of going to the wireless interface (which is connected to the Internet). They eventually time out and sometimes seem to go through the wireless interface but it takes a long time.

    How can I configure Network Manager or /etc/network/interfaces to convince Ubuntu to always route outbound requests through the wireless interface (unless they are responses to a request that came in through the wired interface)? Netmask? Routes?
    Also, I seem to have conflicts between settings in /etc/network/interfaces and /etc/NetworkManager/NetworkManager.conf. If I delete /etc/network/interfaces, all my interfaces disappear and I cannot access network at all.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    outbound requests will use your default route. it should be configured in /etc/network/interfaces. you can show the current status of the default route w/this command:

    Code:
    route -n
    here is example output:

    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
    this says that the ip address 192.168.1.1 (my Verizon wireless router) is being used as my default gateway, and uses the eth0 interface to get there.

    you can manually add a route like this:
    Code:
    sudo route add default gw <gway_ip_addr> dev <interface>
    also, if i had another interface on it (a wireless one, say wlan0) i would make sure not to put it on the 192.168.1.0 network.

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    2

    managing ip traffic across two network interfaces

    Quote Originally Posted by atreyu View Post
    outbound requests will use your default route. it should be configured in /etc/network/interfaces. you can show the current status of the default route w/this command:

    Code:
    route -n
    here is example output:

    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
    this says that the ip address 192.168.1.1 (my Verizon wireless router) is being used as my default gateway, and uses the eth0 interface to get there.

    you can manually add a route like this:
    Code:
    sudo route add default gw <gway_ip_addr> dev <interface>
    also, if i had another interface on it (a wireless one, say wlan0) i would make sure not to put it on the 192.168.1.0 network.
    Thanks atreyu!
    route -n indeed shows eth0 as the default route.
    When I try to change it with sudo route add ... I get a message that says SOICADDRT: No such process
    The default route does not change.
    But I will read more about /etc/network/interfaces and figure out how to set the default gateway in that configuration file. Thanks for explaining to a newbie.

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by dmccue View Post
    route -n indeed shows eth0 as the default route.
    When I try to change it with sudo route add ... I get a message that says SOICADDRT: No such process
    The default route does not change.
    my gw ip addr of 192.168.1.1 was just an example, you should be using the ip address of your router.

    you should delete any existing default gw first, for a given device, before adding a new one, e.g.:

    Code:
    route del default gw <ip_addr> dev <int>
    but, yeah, the best way to do this would be to populate /etc/network/interfaces with the right values for all devices and restart networking using the built-in script.

Posting Permissions

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