1

We have a server to which more than one interfaces (say eth0 and ensp1) are connected to fibre. The two connections are necessary because this machine is used by multiple work, is remote and so physical disconnection of one interface is not possible.

We are trying to install Debian 11 and during the installation we see that even when we try to provide a ip address as manual on say eth0, the other interface also obtains another ip address. Moreover rebooting the system changes the ip address on eth0.

We have tried update-rc.d -f dhcp remove but have been unsuccessful in achieving the goal.

4
  • We need, at minimum, the network topology (how are the two interfaces connected? to the same router? several router?) and some detail of the machine internal network setup. Are both interfaces set in a bridged connection? Are you using Network manager to activate the interfaces? The only network configuration was done in /etc/network/interfaces.d/setup (what is in it?), or no configuration was done ? Sep 6, 2022 at 5:53
  • What you wanna do? ip over dhcp or manualy? manualy ip for both interfaces or more than one ip for both interfaces?
    – Z0OM
    Sep 6, 2022 at 6:44
  • Hi, @Blockchain Office We want to disable dhcp for the interfaces by default. I was trying to modify the iso that comes and have a few services and see if I could reinstall. After installation is done we see the problems specified where on rebooting it takes the ip address even though we use nmtui options to setup the ip address manually in the first instance. Sep 6, 2022 at 18:01
  • Hi @QuartzCristal to answer your question about the same router or several router I will check once more and get back. I have been using the default installation and I figured that by default Network Manager is getting initialized. There is the empty directory /etc/network/interfaces.d/ and no setup files inside. Reading the answers below I will create a setup file and try and give a feedback on how it goes. Sep 6, 2022 at 18:04

1 Answer 1

1

You need to config your /etc/network/interfaces

Example Config:

# for loopback
auto lo
iface lo inet loopback

# dhcp for eth0
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

# you can do the same for ensp1
auto ensp1
allow-hotplug ensp1
iface ensp1 inet dhcp

# manual ip for eth0
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0

# YOU CAN ADD MORE IP'S TO THE INTERFACES WITH eth0:0, eth0:1 eth0:2, etc..
# more than one ip for eth0
auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 10.0.0.100
netmask 255.255.0.0

# You can do the same for ensp1
auto ensp1
allow-hotplug ensp1
iface ensp1 inet static
address 192.178.178.10
netmask 255.255.255.0

# You can do the same for ensp1:0
auto ensp1:0
allow-hotplug ensp1:0
iface ensp1:0 inet static
address 10.10.10.10
netmask 255.255.0.0

On one machine we use DHCP and 3 STATIC IP's for 1 interface

# You can add also a nameserver for eth0, ensp1:0, etc..,
# but i prefer the nameserver in /etc/resolve.conf

auto ensp1:0
allow-hotplug ensp1:0
iface ensp1:0 inet static
address 10.10.10.10
netmask 255.255.0.0
dns-nameserver 10.10.x.x
dns-nameservers 8.8.8.8
nameserver x.x.x.x

For nameserver edit /etc/resolve.conf

nameserver 192.168.x.x # local `
nameserver 8.8.8.8     # google 
nameserver x.x.x.x     # whatever`

Defining the (DNS) Nameservers, The resolv.conf configuration file

How can I refresh resolv.conf after changing the resolv options in the interfaces file?

After edit you can restart and check the network status with:

systemctl restart networking

or

systemctl restart networking.service

or

/etc/init.d/networking restart

Status

systemctl status networking.service

Fit your /etc/netwotk/interfaces to your needs

Check this post if you need more informations from your interfaces:

network devices/interfaces informations

Check the Debian NetworkConfiguration:

Debian NetworkConfiguration

3
  • He can reset the config with askubuntu.com/questions/637637/…. The solution for my post is /etc/network/interfaces like we manage our debian networks and interfaces.
    – Z0OM
    Sep 6, 2022 at 8:39
  • @QuartzCristal is somethink wrong with my solution/answer?
    – Z0OM
    Sep 6, 2022 at 8:44
  • Ok lets wait if he answer with more details
    – Z0OM
    Sep 6, 2022 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .