Difference between revisions of "Setting Up Ubuntu for Ethernet LAN While Preserving Wifi Internet Access"

From RoboJackets Wiki
Jump to navigation Jump to search
(populated real content)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
In 2018, both RoboRacing and IGVC are adding features to their robot which work through the Ethernet hardware. By default, Ubuntu prioritizes the ethernet interface over wifi. In situations where an internet connection is still desired (e.g. SSH connection to robot, pulling from remote changes on git repo onto the robot), Ubuntu can be easily configured to use ethernet for local network connections only.
 
In 2018, both RoboRacing and IGVC are adding features to their robot which work through the Ethernet hardware. By default, Ubuntu prioritizes the ethernet interface over wifi. In situations where an internet connection is still desired (e.g. SSH connection to robot, pulling from remote changes on git repo onto the robot), Ubuntu can be easily configured to use ethernet for local network connections only.
  
=== Procedure: ===
+
=== Creating a LAN-only Network Interface: ===
 
# Open the connections editor from the network drop-down ("Edit Connections...") or launch <code>nm-connections-editor</code>
 
# Open the connections editor from the network drop-down ("Edit Connections...") or launch <code>nm-connections-editor</code>
 
# Select the wired connection (the local one, which we don't want to use for Internet access) and click "Edit"
 
# Select the wired connection (the local one, which we don't want to use for Internet access) and click "Edit"
 
# Under IPv4 settings, change Method to "Manual"
 
# Under IPv4 settings, change Method to "Manual"
# Enter any static IP (e.g. 10.*.*.*), set Netmask to 255.255.255.0 (or 24), and leave Gateway blank
+
# Enter any static IP (e.g. 192.168.2.1), set Netmask to 255.255.255.0 (or 24), and leave Gateway blank
 
# Select "Routes..." and enable "Use the connection only for resources on its network"
 
# Select "Routes..." and enable "Use the connection only for resources on its network"
# Save progress and restart your networking stack: "Enable Networking" or <code>nmcli n off && nmcli n on</code>
+
# Save progress and restart your networking stack: "Enable Networking" twice or <code>nmcli n off && nmcli n on</code>
 
You should now be able to both access the Internet and ping devices on your Ethernet LAN.
 
You should now be able to both access the Internet and ping devices on your Ethernet LAN.
 +
 +
=== Adding a Second Interface for Normal Internet Usage ===
 +
This is useful if you are testing on a personal laptop and sometimes like to use Ethernet like a normal person.
 +
# Open the connections editor
 +
# Select "Add..." and then "Ethernet"
 +
# Set IPv4 Method to "Automatic (DHCP)"
 +
# It should be easy to switch between the two interfaces through the network manager menu or the <code>nmcli</code> tool.
 +
 +
[[Category:How to Guides: Technical]]
 +
[[Category:Software]]

Latest revision as of 20:25, 24 May 2020

In 2018, both RoboRacing and IGVC are adding features to their robot which work through the Ethernet hardware. By default, Ubuntu prioritizes the ethernet interface over wifi. In situations where an internet connection is still desired (e.g. SSH connection to robot, pulling from remote changes on git repo onto the robot), Ubuntu can be easily configured to use ethernet for local network connections only.

Creating a LAN-only Network Interface:

  1. Open the connections editor from the network drop-down ("Edit Connections...") or launch nm-connections-editor
  2. Select the wired connection (the local one, which we don't want to use for Internet access) and click "Edit"
  3. Under IPv4 settings, change Method to "Manual"
  4. Enter any static IP (e.g. 192.168.2.1), set Netmask to 255.255.255.0 (or 24), and leave Gateway blank
  5. Select "Routes..." and enable "Use the connection only for resources on its network"
  6. Save progress and restart your networking stack: "Enable Networking" twice or nmcli n off && nmcli n on

You should now be able to both access the Internet and ping devices on your Ethernet LAN.

Adding a Second Interface for Normal Internet Usage

This is useful if you are testing on a personal laptop and sometimes like to use Ethernet like a normal person.

  1. Open the connections editor
  2. Select "Add..." and then "Ethernet"
  3. Set IPv4 Method to "Automatic (DHCP)"
  4. It should be easy to switch between the two interfaces through the network manager menu or the nmcli tool.