linux set ip address code example
Example 1: display ip address linux
#private ip
hostname -I
or
ifconfig
or
ip addr show
#public ip
curl ifconfig.me
Example 2: show ip address linux
$ hostname -I
Example 3: new ip linux
Get new ip from DHCP (If not working, check your connection to router)
//Release ip
sudo dhclient -r [Interface name](optional)
//Renew ip
sudo dhclient [Interface name](optional)
Example 4: linux set ip static
ip address add 172.16.251.1/24 brd + dev wlan0:0