Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 835  / 2 Years ago, sun, december 12, 2021, 11:29:36

I'm running Kubuntu 20.10 on a desktop machine. Previously I had set my Ethernet to use a manual IP address (192.168.0.114). On the new network the subnet is 192.168.1.XXX, so I tried to set the network adapter to automatic and hit Save in the Network Settings screen. After disconnecting the cable and reconnecting it, it reverts back to the Manual IP address. Also when I run hostname -I it shows the old IP address.


Not sure what is going on here. Is there a way to completely wipe the network settings? Or is there a file I can edit to change the network settings rather than through the GUI?


Result of cat /etc/network/interfaces


# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

Result of cat /etc/netplan/*.yaml


# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager

cat /etc/hosts


127.0.0.1       localhost
127.0.1.1 linuxamd

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

cat /etc/hostname


linuxamd

hostname -I


192.168.0.114 192.168.1.83 2600:1700:5ef0:67b0:5771:7bd0:b3d9:a26f 2600:1700:5ef0:67b0:febd:52a0:bd99:a94a 2600:1700:5ef0:67b0::2e 2600:1700:5ef0:67b0:f7c6:4441:3233:87ba 2600:1700:5ef0:67b0:6aba:cca1:cc53:2a06

EDIT (Sep 11, 2021): I can get it to work by running sudo dhclient -r and then sudo dhclient. It will still show the old static IP address and the new one. But I have to do that every time I restart the machine. So still not a good solution.


More From » networking

 Answers
6

I finally found the problem. I ran sudo grep -rIH 192.168.0.114 in /etc. It listed dhcpcd.conf file as having that value. In the file at the very bottom it was setting it as a static ip. See below:


interface enp4s0
static ip_address=192.168.0.114/24
static routers=192.168.0.1
static domain_name_servers=1.1.1.1 1.0.0.1

I comment those 4 lines and restarted the machine. Now it picks up the right IP address from the router!


[#1578] Monday, December 13, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
socelebrate

Total Points: 274
Total Questions: 123
Total Answers: 124

Location: Saint Helena
Member since Mon, Jan 16, 2023
1 Year ago
;