I have set a static IP on my ubuntu server and I could SSH into the server using the static IP (192.168.178.27
). BUt when I use ifconfig
command , I see a different IP (192.168.178.24
). Moreover, when I run ip addr show
, I see two IPs for the same interface (wlp58s0
).
How do I rectify this ?
$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 94:c6:91:14:86:91 brd ff:ff:ff:ff:ff:ff
3: wlp58s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 88:b1:11:99:66:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.178.24/24 brd 192.168.178.255 scope global dynamic wlp58s0
valid_lft 85719sec preferred_lft 85719sec
inet 192.168.178.27/24 brd 192.168.178.255 scope global secondary wlp58s0
$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
ether 02:42:91:0b:d3:fb txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 123 bytes 9912 (9.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 123 bytes 9912 (9.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp58s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.178.24 netmask 255.255.255.0 broadcast 192.168.178.255
inet6 fe80::bb3e:5309:292d:e32b prefixlen 64 scopeid 0x20<link>
ether 88:b1:11:99:66:00 txqueuelen 1000 (Ethernet)
RX packets 14904 bytes 21544564 (21.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2030 bytes 244273 (244.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Content of /etc/network/interfaces
:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# Generated by debian-installer.
# The loopback interface
auto lo
iface lo inet loopback
auto wlp58s0
iface wlp58s0 inet static
address 192.168.178.27
netmask 255.255.255.0
gateway 192.168.178.1
dns-nameservers 8.8.8.8 8.8.4.4
Content of netconf
:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
wlp58s0:
dhcp4: yes
addresses: [192.168.178.27/24]
gateway4: 192.168.178.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]