Skip to content

Instantly share code, notes, and snippets.

@CSpyridakis
Created June 6, 2024 18:45
Show Gist options
  • Select an option

  • Save CSpyridakis/ed594c4f52d69b3d09ad73f10ca7a685 to your computer and use it in GitHub Desktop.

Select an option

Save CSpyridakis/ed594c4f52d69b3d09ad73f10ca7a685 to your computer and use it in GitHub Desktop.
  1. You need netplan support!

  2. Install also network manager sudo apt install network-manager

  3. Inside this file store the contents below sudo nano /etc/netplan/01-anyname.yaml

network:                              
  version: 2                          
  renderer: NetworkManager            
  ethernets:                          
    enp0s8:                           
      dhcp4: no                       
      addresses: [<staticip>/24]   
      routes:                         
        - to: default                 
          via: <gateway>          
      nameservers:                    
          addresses: [8.8.8.8,8.8.4.4]
  1. Then run: sudo netplan try

  2. To disable another link run: sudo ip link set [Interface name] down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment