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.
managing ip traffic across two network interfaces
Quote:
Originally Posted by
atreyu
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:
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.