You are not logged in.
Pages: 1
Trying to get a rolling updates distro going. I managed to successfully make my network work (have internet, IPs are assigned, internet is being shared, ...) but there's some weird stuff going on.
What I have
It's basically a home-router with some services (dhcp, apache, ssh, ftp, printer, ...). It connects to my modem and shares internet to the house.
The basic layout is this (sorry, couldn't build to scale or paint the model):
Modem ---- enp5s0 --- Computer ---- enp1s0 --- Cisco switch ---- House
enp5s0: Connects to the modem using ppp0 with a user and a password. I do have a fixed IP address (187.xxx.xxx.xxx) from my ISP but it's assigned to me by DHCP (i.e.: I can't just set my IP to this or my ISP gets angry).
enp1s0: Connects to my local network and gets the fixed IP address 192.168.0.1.
Here it starts to get weird. Somehow (I didn't even know this was possible) enp5s0 gets 2 ip addresses. It gets my external IP (187.xxx.xxx.xxx) and it also gets 192.168.0.101 from my dhcp server.
$ ip a
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 noprefixroute
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 50:3e:aa:0c:db:e0 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0.255 scope global enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::f69c:9c4:583b:a38d/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::523e:aaff:fe0c:dbe0/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:f1:f3:a7:60:b8 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.101/24 brd 192.168.0.255 scope global dynamic noprefixroute enp5s0
valid_lft 5724sec preferred_lft 4824sec
inet6 fe80::29e5:1e77:cb59:91b1/64 scope link
valid_lft forever preferred_lft forever
4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq_codel state UNKNOWN group default qlen 3
link/ppp
inet 187.xxx.xxx.xxx peer 10.255.255.2/32 scope global ppp0
valid_lft forever preferred_lft forever
Config files:
/etc/systemd/network/enp1s0.network
/etc/systemd/network/enp5s0.network
/etc/dhcpcd.conf
/etc/dhcpd.conf
$ cat /etc/ppp/peers/provider
plugin pppoe.soenp5s0
name "xxx"
usepeerdns
persist
defaultroute
hide-password
noauth
I don't know if this is a problem but:
$ journalctl -u dhcpd4
...
Jul 23 07:05:51 section-ten dhcpd[805]: Multiple interfaces match the same subnet: enp1s0 enp5s0
Jul 23 07:05:51 section-ten dhcpd[805]: Multiple interfaces match the same shared network: enp1s0 enp5s0
...
My dhcp server is giving the .101 address:
$ journalctl -u dhcpd4
...
Jul 23 08:05:18 section-ten dhcpd[805]: DHCPREQUEST for 192.168.0.101 from 00:f1:f3:a7:60:b8 via enp5s0
Jul 23 08:05:18 section-ten dhcpd[805]: DHCPACK on 192.168.0.101 to 00:f1:f3:a7:60:b8 via enp5s0
...
As far as I know I don't have two dhcp servers. I am sure there's not a second dhcp server running in other machines so if there's one, it's in the same computer.
systemctl --type service
What I've tried so far
- Manually removing the ip address from enp5s0 (ip addr del 192.168.0.101/24 dev enp5s0) to see what happens. It just requests another IP from the dhcp server and get 101 back from it.
- Stopping/removing dhcp client from enp5s0 and restarting the system
systemctl stop dhcpcd@enp5s0; ip addr del 192.168.0.101/24 and enp5s0 just gets the .101 ip back
systemctl disable dhcpcd@enp5s0 and restarting has the same outcome as well
- Removing the /etc/systemd/network/enp5s0.network file and restarting doesn't change anything as far as I can tell
There's no video card in the computer (I removed it after installation) so I can only access it by ssh. Would appreciate suggestions/solution that wouldn't lock me out of the system. Thanks.
SOLUTION
As pointed out @Lone_Wolf, I had both systemd-networkd and dhcpcd installed and running and they weren't getting along so I removed dhcpcd and rebooted the system. The system came back online but without internet because enp5s0 was not being brought up during boot. This happened because during the tests, I ended up moving the enp5s0.network file from /etc/systemd/network to /root temporarily to test things out. Turns out I copied the file back with the wrong permissions 600 instead of 644 and systemd-networkd couldn't read it. After changing that the interface enp5s0 still got the funky IP so I removed "[Network] [DHCP]=true" from its configuration and now everything seems be working fine.
Thanks @Lone_Wolf for the help.
Last edited by nszeek (2023-07-23 13:41:09)
Offline
systemd-networkd & systemd-resolved conflict and compete with dhcpcd .
Choose one and stop/disable the other.
Do you have physical access to the machine ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
systemd-networkd & systemd-resolved conflict and compete with dhcpcd .
Choose one and stop/disable the other.
Do you have physical access to the machine ?
I have physical access to the machine but it takes some time to install a GPU and change the PSU so that it can run the GPU and then change it back (trying to save a few bucks on the power bill).
Any way to know which one I should disable without bricking the setup?
Last edited by nszeek (2023-07-23 11:51:11)
Offline
What address & device are you connecting to for the ssh connection ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
What address & device are you connecting to for the ssh connection ?
I connect to 192.168.0.1 which is enp1s0.
I just decided to roll the dice and systemctl disable dhcpcd and rebooted the system. I managed to get back in with ssh (enp1s0 still had 192.168.0.1) but enp5s0 (and ppp0) didn't go up anymore so I was left without internet access.
Update
Tried to change enp5s0.network to include [Network], [DHCP]=true
systemctl disable dhcpcd
reboot
System comes back, can login with ssh, no internet because enp5s0 is down. I tried:
ip link set dev enp5s0 up
systemctl restart ppp@provider.service
Now I have internet again and enp5s0 doesn't have the weird IP.
How can I make this the default behavior upon boot?
Update 2
/etc/systemd/network/enp5s0.network had the wrong permissions, changing this brought the interface up at boot. Full solution added to initial post.
Last edited by nszeek (2023-07-23 13:41:54)
Offline
Pages: 1