This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. **{{ :the_linux_command_line_-_19.01.pdf |The Linux Command Line (ebook - authoritative)}}** ==== LINUX REFERENCE ==== ==== Set a static IP ==== 1. Install network-manager if it’s not already installed: sudo apt install -y network-manager 2. Get the current IP address and the name of the Ethernet interface ip a 3. Ping the desired static IP address to make sure some other machine isn’t already using it. (Command below assumes a desired IP address of 10.10.10.111) ping -c 8 10.1.1.111 4. If a machine responds to the pings, find it, and shut it down (if it’s using back with (Assuming an interface name of enp1s0) ==== Setting a Static IP Address on Ubuntu Server ==== Ubuntu Server 22.04/24.04LTS uses a utility called ‘netplan’ for networking. To set a static IP we need to edit the config file. <code> sudo nano /etc/netplan/0[hit tab to autocomplete whatever the filename is] </code> The static IP config should look similar to this: <code> network: renderer: networkd ethernets: eth0: addresses: - 10.1.11.88/24 nameservers: addresses: [1.1.1.2,9.9.9.9,8.8.8.8] routes: - to: default via: 10.1.1.1 version: 2 </code> Save the file and exit Run the following command to set the permissions for the config file: <code> sudo chmod 0600 /etc/netplan/00-installer-config.yaml </code> To apply the changes run the following command: <code> sudo netplan apply </code> To confirm the settings, run the following to see the current IP: <code> ip addr show eth0 </code> Run the following to see the default gateway: <code> ip route show </code> Run the following command to see the DNS servers being used: <code> resolvectl status </code> ==== File/directory permissions/ownership ==== {{ :chmod-chown_-_file_directory_permissions_ownership.pdf |chmod/chown}}