[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Under each of these scenarios, what is the neatest and simplest way to manipulate the /etc/network/interfaces file?



Hi

There are instances in which my machine is connected to a mobile hotspot. And in some situations, it's connected to a smartphone via USB tethering. And when I'm in the office, I may connect it to a LAN cable.

Below are the contents of my /etc/network/interfaces file:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug enx61s07
#iface enx60a4b79d7f48 inet static
#       address 192.168.1.35/24
#       gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
#       dns-nameservers 1.1.1.1 8.8.8.8


# The primary network interface for USB tethering
allow-hotplug usb0
iface usb0 inet dhcp static
         address 192.168.42.35
         gateway 192.168.42.1
        # dns-* options are implemented by the resolvconf package, if installed
         dns-nameservers 1.1.1.1 8.8.8.8

# The primary network interface for wireless connections
#allow-hotplug wlo1
#iface wlo1 inet dhcp static
#         wpa-ssid Osia27
#         wpa-psk string-of-alphanumberice-characters
#         address 192.168.43.28
#         gateway 192.168.43.1
#         dns-nameservers 1.1.1.1 8.8.8.8

Questions:

1. At the moment, if I wish to change to using a mobile hotspot from USB tethering, I'll edit the /etc/network/interfaces file, uncomment the applicable lines under #The primary network interface for wireless connections and place a # in front of all the lines under #The primary network interface for USB tethering

Instead of carrying out the above steps, is there a neater and simpler way?

2. What is the command to type in a terminal after I have made changes to the /etc/network/interfaces file without rebooting my machine?

Best regards.

Stella


Reply to: