Notes
GitHub
  • Home
  • SSH
    • Allow a single IP to login
    • Changing the default SSH port
    • Disable root login
    • Setting a Custom SSH Warning Banner
    • Setting up idle timeout
    • Setting up limited password retries
    • Using public/private key pair instead of password
  • Apps
    • Cloud-init
      • Enable SSH password authentication
    • Git
    • Ping
    • Keepalived
    • Rsync
    • Chisel
    • OpenVPN
      • Running OpenVPN connection as a service
    • Redis
  • Linux
    • Package Management
      • Configuring automated security updates
      • Download using fastest mirror
    • Memory
      • Clearing Memory Cache, Buffer and Swap Space
    • Troubleshooting
      • APT
        • Apt-key deprecation warning when updating system
      • Failed to open "/etc/machine-id": No such file or directory
    • Cheat sheet
      • Disk
      • File / Folder
      • Network
      • Process
      • Time
      • Power
    • Network
      • Disable IPv6
      • Network Teaming
      • Set static IP
    • Partition
    • User
      • Change user's default shell
      • Create new user account
  • VMware
    • Hide the fact that running in a VM
    • Datastore conflicts with an existing datastore in the datacenter that has the same URL
    • The OVF package is invalid and cannot be deployed.
  • Windows
    • Domain Controllers
Powered by GitBook
On this page

Was this helpful?

  1. Linux
  2. Network

Set static IP

  1. Add this in /etc/netplan/<interface_name>.conf

    network:
      ethernets:
        ens160:
          dhcp4: false
          addresses: [192.168.x.x/24]
          nameservers:
            addresses: [192.168.x.x,192.168.x.x]
          routes:
            - to: default
              via: 192.168.x.x
      version: 2
  2. Modify the following:

    • interface name - ens160

    • ip address - 192.168.x.x

    • default route - 192.168.x.x

    • nameservers - 192.168.x.x

  3. Save and exit. Run sudo netplan apply to update.

Last updated 1 year ago

Was this helpful?