How to configure network settings in Ubuntu?

by damian_mills , in category: General Help , a year ago

How to configure network settings in Ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by noemy.bosco , a year ago

@damian_mills 

To configure network settings in Ubuntu, you can use the graphical user interface or the command line interface.


Using the Graphical User Interface:

  1. Click on the network icon in the top right corner of the screen.
  2. Click on the gear icon to open the settings menu.
  3. Click on "Network" in the left-hand menu.
  4. From there, you can select your network connection and modify the settings as needed.


Using the Command Line Interface:

  1. Open the terminal by pressing "Ctrl + Alt + T" or searching for "terminal" in the Applications menu.
  2. Type the following command to open the network settings file:
1
sudo nano /etc/netplan/01-network-manager-all.yaml


  1. Modify the network settings as needed using YAML syntax. For example, to change the IP address of a network interface, you can add the following lines to the file:
1
2
3
4
5
6
7
8
network:
    ethernets:
        enp0s3:
            addresses: [192.168.0.2/24]
            gateway4: 192.168.0.1
            nameservers:
                addresses: [8.8.8.8, 8.8.4.4]
    version: 2


  1. Save and close the file by pressing "Ctrl + X", then "Y", and then "Enter".
  2. Apply the changes using the following command:
1
sudo netplan apply


Note: The network interface name and IP address shown in the above example may differ in your system, so be sure to use the correct values for your network configuration.