debian-12 lxc container. how to configure persistent route?

Sidius

New Member
Oct 4, 2024
11
0
1
Hello

I need make a persistent route of subnet 10.0.0.0/24 to host 192.168.0.200 via eth0 in my new debian 12 lxc container and i cannot :((

i tried to edit /etc/network/interfaces file with
Code:
auto eth0
iface eth0 inet static
        address 192.168.0.100/24
        down route del 10.0.0.0/24 via 192.168.0.200 dev eth0
        up route add 10.0.0.0/24 via 192.168.0.200 dev eth0

when i do systemctl restart networking it returns
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xeu networking.service" for details.

how to make persistent route in debian 12 lxc container?
 
Hi,

Code:
down route del 10.0.0.0/24 via 192.168.0.200 dev eth0
up route add 10.0.0.0/24 via 192.168.0.200 dev eth0
these lines should read
Code:
down ip route del 10.0.0.0/24 via 192.168.0.200 dev eth0
up ip route add 10.0.0.0/24 via 192.168.0.200 dev eth0
since ip route is the actual command you are trying to use.

when i do systemctl restart networking it returns
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xeu networking.service" for details.
Also, it is always helpful to provide all the error messages - in this case, running journalctl -xeu networking.service would have probably revealed that it fails to run the route command, since it probably does not exist.
 
Nothing special there (if so, i've fixed problem by myself)

Code:
# journalctl -xeu networking.service
Oct 25 02:47:07 nat systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit networking.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Oct 25 02:47:07 nat systemd[1]: networking.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit networking.service has entered the 'failed' state with result 'exit-code'.
Oct 25 02:47:07 nat systemd[1]: Failed to start networking.service - Raise network interfaces.
-- Subject: A start job for unit networking.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit networking.service has finished with a failure.
--
-- The job identifier is 3359 and the job result is failed.

Maybe i need to restart CT to apply changes? If i do systemctl restart networking with default /etc/network/interfaces - it returns the same error.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!