Skip to content

Instantly share code, notes, and snippets.

@Vaneeza-7
Last active February 17, 2025 21:38
Show Gist options
  • Save Vaneeza-7/69c875b77ce4f9d88950c3aac0c8b1e7 to your computer and use it in GitHub Desktop.
Save Vaneeza-7/69c875b77ce4f9d88950c3aac0c8b1e7 to your computer and use it in GitHub Desktop.
Configure IP address on Ubuntu
#!/bin/bash
clear
setIP(){
ip addr show
sudo gedit /etc/network/interfaces #edit dns maskgateway and ip here, (ipconfig functionality)
sudo netplan try #configure IP
sudo netplan apply
ip a #check if ip has changed or not
}
#call the function here
setIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment