2

I have a wireless internet that goes out to the Internet, but I have Ethernet set up for a private internal non-Internet-facing network.

When I connect my Ethernet on this private static configuration, I lose Internet access as it tries to use Ethernet as the route.

Is there a way to manually specify that the default route for internet traffic should be via the wifi instead of via the ethernet?

NOTE: This is on a Laptop - it uses MULTIPLE Wireless networks with DIFFERENT IPs/Gateways. Setting the default gateway by hand on the command line is not feasible for this setup. It is also unfeasible because I sometimes VPN my data over my home VPN connection when off-site.

Thomas Ward
  • 72,494
  • 30
  • 173
  • 237
  • 1
    You might find this interesting: http://serverfault.com/questions/589673/changing-the-default-gateway-multiple-nics – Elder Geek Jan 23 '15 at 15:44
  • I think I would add static routes to the internal services and set the default gw (used for unknown ip's) to the wireless gateway – Elder Geek Jan 23 '15 at 15:55
  • 1
    As @ElderGeek implies, I doubt you can do this with Network Manager, but rather use /etc/network/interfaces. – chili555 Jan 23 '15 at 16:05
  • @chili555 that breaks DHCP and the settings for multiple wifi networks in NetworkManager in a GUI setup. If it's not possible, then we need to yell at Ubuntu for failing in this regard. – Thomas Ward Jan 23 '15 at 16:08
  • @ElderGeek Impossible when you are using multiple wifi networks as one might in a laptop - hence the question here – Thomas Ward Jan 23 '15 at 16:10
  • @ThomasW. My apologies for the confusion. Perhaps you could edit your question and change "a wireless network" to "multiple wireless networks" to provide more clarity. Thank you! – Elder Geek Jan 23 '15 at 16:12
  • @ElderGeek done – Thomas Ward Jan 23 '15 at 16:13
  • Thinking outside the box, If there's something I don't wish to do by hand, I usually develop a script for it. – Elder Geek Jan 23 '15 at 16:17
  • @ElderGeek Perhaps a wider range question: Is there a way with command line tools and network manager negotiating the connection parameters (DHCP, etc.) to define the ethernet interface for the default route? (The other consideration is, I use VPN sometimes, so... adds to the complication) – Thomas Ward Jan 23 '15 at 16:18
  • @ThomasW. Not sure I understand how /etc/network/interfaces breaks DHCP. You can certainly specify _iface wlan0 inet dhcp_. – chili555 Jan 23 '15 at 16:18
  • @chili555 it breaks Network Manager handling of the connection - in which different wifi networks I have different DNS servers – Thomas Ward Jan 23 '15 at 16:19
  • I see, it breaks NM but not DHCP, then. – chili555 Jan 23 '15 at 16:20

0 Answers0