Two interfaces on DHCP assign two default gateways
Hi,
I have a Ubuntu box that has two networking interfaces (eth0 and wlan0). They are both configured for DHCP in /etc/network/
-- /etc/network/
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
wireless-essid test
--
-- Result of 'route -n'
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.16.1.1 0.0.0.0 UG 100 0 0 wlan0
0.0.0.0 10.0.0.1 0.0.0.0 UG 100 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.16.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
--
How can I set up /etc/network/
Worst case scenario, how can I at least control which one gets on top on the 'route -n' command, each boot?
NOTE 1: This box will travel a lot, and will be connected to different networks, so I don´t know in advance the IP addresses/ranges it will have.
NOTE 2: Sometimes the default gw interface will be eth0. Sometimes it will be wlan0 ... So, this needs to be kind of automatic ...
Hope someone can help me out ;)
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu dhcp Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Martin A. Rubio for more information if necessary.