Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3181  / 1 Year ago, wed, april 19, 2023, 9:44:15

Removing netplan.io causes no immediate effects (network still works), but the next time the server is restarted, there is no network. That means netplan.io is responsible for some aspect of configuration (obviously), and the OS is able to use the network, if it's properly configured.


I have tried these steps to attempt to manually bring up the network without netplan.io:



  1. ifconfig eth0 up brings some semblence of IPv6 up, but no IPv4. No network access.

  2. dhclient eth0 (after #1) hangs forever, i.e. does nothing.

  3. The ifup command does not exist.

  4. The /etc/network/interfaces file does not exist.


Here is the configuration I am able to extract from netplan get while it is installed:


network:
version: 2
ethernets:
eth0:
addresses:
- "<censored>/24"
gateway4: <censored>

It looks extremely basic but I somehow can't find out how to apply it without netplan.io.


My end goal is to get network working without netplan.io installed, and automatically on system startup. I cannot find any packages to try installing in order to facilitate this. I can only find guides on how to edit /etc/network/interfaces, but that isn't applicable here. On top of that, apt-file cannot find any package that contains that file, so I can't even make it applicable.


How do I keep ethernet working without netplan.io?


EDIT: I finally found a sequence of commands that properly configures the network:


ifconfig eth0 <address> netmask 255.255.255.0
route add default gw <gateway4> eth0
ifconfig eth0 up

DNS name resolution even works too! Now just to find a way to perform this automatically on boot... maybe an @reboot cron job, but that feels hacky...


More From » networking

 Answers
3

On Terrance's suggestion, I installed ifupdown which seems to be the package that adds /etc/network/interfaces. Not sure why apt-file couldn't find it.


After adding this to /etc/network/interfaces:


auto eth0
iface eth0 inet static
address <censored>
netmask 255.255.255.0
gateway <censored>

and making sure the networking service was enabled (systemctl enable networking), I now have network access on every boot. Success!


[#675] Friday, April 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gliroopy

Total Points: 290
Total Questions: 115
Total Answers: 114

Location: Egypt
Member since Tue, May 3, 2022
2 Years ago
;