Setup a secondary IP
make your host available on a specific alternative IP address - chatGPT
Ubuntu 22+ / Debian 12
list all network interface (even unconnected) ls /sys/class/net
or ifconfig -a
Check if you are using netplan or NetworkManager
cat /etc/netplan/1-network-manager-all.yaml => default to NetworkManager
NetworkManager
this is dependant of the interface: changing a usb dongle will hide it.
$ nmcli connection show
# You'll see something like: NAME: Wired connection 1 ... DEVICE: enp0s3
# if nothing => probably not using NetworkManager.
# Add the alternative IP
$ sudo nmcli connection modify "Wired connection 1" +ipv4.addresses 192.168.0.134/24
# Ensure manual addressing is enabled (alongside DHCP):
$ sudo nmcli connection modify "Wired connection 1" ipv4.method auto
# Apply change
$ sudo nmcli connection down "Wired connection 1" && sudo nmcli connection up "Wired connection 1"
# Check your IPs:
$ ip addr show enp0s3Netplan
cat /etc/netplan/xx.yml
see ChatGPT
Written on May 10, 2025, Last update on May 16, 2025
network
linux-system