Network Configuration - /etc/nework/interfaces not working

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
herlitml
Posts: 1
Joined: 2024-10-07 15:52

Network Configuration - /etc/nework/interfaces not working

#1 Post by herlitml »

Hello, People.
I'm configuring Debian 12(Bookworm) on a physical server and I have a problem while setting up my network info.
I tried to set up a very basic /etc/network/interfaces configuration but Debian apparently doesn't read the interfaces file.
This is my setup:

Code: Select all

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address IPADDRESS/MASK
gateway GW-IPADDRESS
dns-nameservers 8.8.8.8
I restart the service with sudo systemctl restart networking and it restarts properly, but the configuration is never set up. No changes are made to my eth0, gw or DNS
I can set up almost everything on the command line but the DNS, which I need to run packages updates.

Any ideas why Debian won't read/pay attention to such a simple config?
Thanks
Herlit

Aki
Global Moderator
Global Moderator
Posts: 3949
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Network Configuration - /etc/nework/interfaces not working

#2 Post by Aki »

Hello,

What is the output of the following commands ?

Code: Select all

ip link
ip address
ifdown -a
ifup -v -a
--
note: please, use code tags to include commands and/or their logs in the body of a message.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

herlitml
Posts: 1
Joined: 2024-10-07 15:52

Re: Network Configuration - /etc/nework/interfaces not working

#3 Post by herlitml »

Hi, thanks for the quick reply.
I added a vlan(vlan100) with this being my full config to /etc/network/interfaces:

Code: Select all

auto eth0
iface eth0 inet manual
pre-up ifconfig $IFACE up
post-down ifconfig $IFACE down

auto vlan100
iface vlan100 inet static
address PRIVATE IP ADDRESS/16
gateway MY GATEWAY
dns-nameservers 8.8.8.8
vlan-raw-device eth0
systemctl restart networking now works. My eth0 interface shows and DHCP IP address, the first IP from one of my class b subnets. I've checked DHCP services/client
but I have none configured in the server.

Here are the commands output:

ifdown -a --took all the interfaces down.

Code: Select all

$ sudo ifup -v -a 
run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/vlan
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/ip
run-parts: executing /etc/network/if-up.d/resolved
run-parts: executing /etc/network/if-up.d/wpasupplicant

Code: Select all

$ sudo ip address

8: vlan100@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether MAC ADDRESS HERE
    inet MY-PRIVATE-IPADDRESS/24 brd MY-PRIVATE-BROADCAST scope global vlan173
       valid_lft forever preferred_lft forever
    inet6 MAC ADDRESS HERE scope link
       valid_lft forever preferred_lft forever

Code: Select all

$ sudo ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback MAC ADDRESS HERE
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
    altname eno1
    altname enp55s0f0
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
    altname eno2
    altname enp55s0f1
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
    altname eno3
    altname enp55s0f2
5: eth3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
    altname eno4
    altname enp55s0f3
6: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
    altname eno5
    altname enp55s0f4
7: eth5: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
    altname eno6
    altname enp55s0f5
8: vlan100@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether MAC ADDRESS HERE
Last edited by herlitml on 2024-10-07 19:13, edited 1 time in total.

Aki
Global Moderator
Global Moderator
Posts: 3949
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 109 times
Been thanked: 518 times

Re: Network Configuration - /etc/nework/interfaces not working

#4 Post by Aki »

So, do you get sorted ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply