I'm trying to add one main IP, two extra IP and one IP6. Here is my interfaces file located at /etc/network/interfaces:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug ens192
iface ens192 inet static
address 23.227.198.250/26
gateway 23.227.198.194
dns-nameservers 8.8.8.8
dns-search deb12.domain.com
auto ens192:0
iface ens192:0 inet static
address 23.227.198.253
gateway 23.227.198.194
auto ens192:1
iface ens192:1 inet static
address 23.227.198.254
gateway 23.227.198.194
iface ens192 inet6 static
address 2a02:748:4000:6::0199/64
gateway 2a02:748:4000:6::1
Then I restart networking using the command below:
output of the command systemctl restart networking:
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.
Then journalctl -x says:
Subject: A start job for unit networking.service has begun execution
Defined-By: systemd
Support: https://www.debian.org/support
A start job for unit networking.service has begun execution.
The job identifier is 412.
ifup[2057]: RTNETLINK answers: File exists
ifup[2048]: ifup: failed to bring up ens192:1
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.
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'.
systemd[1]: Failed to start networking.service - Raise network interfaces.
Subject: A start job for unit networking.service has failed
Defined-By: systemd
A start job for unit networking.service has finished with a failure.
The job identifier is 412 and the job result is failed.
the output of systemctl status networking:
networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-11-20 04:53:15 EST; 3min 15s ago
Docs: man:interfaces(5)
Process: 2048 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 2074 ExecStopPost=/usr/bin/touch /run/network/restart-hotplug (code=exited, status=0/SUCCESS)
Main PID: 2048 (code=exited, status=1/FAILURE)
CPU: 18ms
systemd[1]: Starting networking.service - Raise network interfaces...
fup[2057]: RTNETLINK answers: File exists
ifup[2048]: ifup: failed to bring up ens192:1
systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: networking.service: Failed with result 'exit-code'.
ystemd[1]: Failed to start networking.service - Raise network interfaces.
I could not find any solution for this issue on web. It means a lot to me if you could help me to resolve this issue.
I've tried rewriting the network file and checked if I have any typo in it.
Also, vim does not highlight the comments in the file (I've deleted the comments while posting here), So I'm thinking that maybe the OS does not recognize this file as it should be.
I also checked the chmod and chown of this file and everything is fine.
Something strange has happened, even though I receive the error (mentioned above), I can ping all IPs (V4 and V6) from my local network. Also, I can ping google IPv4 and IPv6 from this server.