[Solved] How to set static IP address(es)? What am I doing wrong?

Linux Kernel, Network, and Services configuration.
Message
Author
Andy
Posts: 13
Joined: 2024-06-23 13:44

[Solved] How to set static IP address(es)? What am I doing wrong?

#1 Post by Andy »

I have a VirtualBox VM running Debian (bookworm) that I'm having trouble setting a static IP address for, and at the same time prevent it from requesting a DHCP address..

I have tried two (2) different methods. The first method is the most prevalent on the internet, but it doesn't seem to persist after a reboot. I have looked at many YouTube videos and websites. When I reboot the VM, it goes right back to the DHCP address that it had before.

I want to set my VM with more than one (1) IP address and here's what I have tried.

METHOD 1 (which does NOT work after reboot)

Code: Select all

su
cp /etc/network/interfaces ~/
vi /etc/network/interfaces
I want to change this:

Code: Select all

root@debian:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet dhcp
root@debian:~# 
to this:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

#The primary network interface
auto enp0s3
iface enp0s3 inet static
address 192.168.1.190/24

iface enp0s3 inet static
address 192.168.1.191/24
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4

Code: Select all

systemctl reboot
When the VM comes back up, the same DHCP address that was assigned before (192.168.1.171) is still there and active. I can't ping the new address nor can I SSH to the new address. I'm stumped. I hope someone can spot what I'm doing wrong.

METHOD 2 (Which DOES work after reboot, but still retains the old, DHCP address, which I want to get rid of. I found this tutorial here: https://shape.host/resources/how-to-con ... -beginners ).

Code: Select all

su
vi /etc/systemd/network/20-wired-static.network

[Match]
Name=enp0s3

[Network]
Address=192.168.1.190/24
Address=192.168.1.191/24
Gateway=192.168.1.1
DNS=8.8.8.8
DNS=8.8.4.4

echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
systemctl enable --now systemd-networkd
systemctl reboot
I welcome your input as to which method is "correct" and/or what I am doing wrong. Also, how do I eliminate the NIC from requesting (and receiving) a DHCP address?

Thank you,
Andy
Last edited by Andy on 2024-07-04 12:36, edited 2 times in total.

lindi
Debian Developer
Debian Developer
Posts: 571
Joined: 2022-07-12 14:10
Has thanked: 2 times
Been thanked: 113 times

Re: How to set static IP address(es)? What am I doing wrong?

#2 Post by lindi »

Please edit your post to use code tags for command output. The NIC does not send DHCP requests but there are multiple software components that do. You have mentioned ifupdown, NetworkManager and systemd-networkd. Choose one that you like and don't configure all of them at the same time.

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#3 Post by Andy »

Thank you.

I don't know what you mean "use code tags for command output.", so I have removed the output.

In short, I'm just simply trying to find a way to set persistent static IP address(es) from the command line, and eliminate any DHCP assigned address. I'm having trouble finding a method that achieves both of these goals.

Andy

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 1084
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 117 times
Been thanked: 189 times

Re: How to set static IP address(es)? What am I doing wrong?

#4 Post by wizard10000 »

I added the code tags.
we see things not as they are, but as we are.
-- anais nin

CwF
Global Moderator
Global Moderator
Posts: 3073
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 63 times
Been thanked: 254 times

Re: How to set static IP address(es)? What am I doing wrong?

#5 Post by CwF »

I would declare once and simply in /etc/network/interfaces.d/emp0s3.conf

Code: Select all

allow-hotplug enp0s3
    iface enp0s3 inet static
        your specifics
Personally I would remove networkmanager and all the systemd network edits.

Part of the issue I don't personally do, is the use of a static address on a dhcp served line. I'd simply look up the address, or use the vm's dns name. More specifically, I usually would use two interfaces, one dhcp for the internet, and a separate line with static addresses with no dhcp server of any kind anywhere for all ssh or internal communications, aka the intranet line, assuming all machines are local.
Andy wrote: 2024-06-24 17:08 I don't know what you mean "use code tags for command output.",
In a moment I will go into your post and add 'code tags'......
Never mind, good job!
Mottainai

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#6 Post by Andy »

Thank you for your feedback.

I CAN use the /etc/network/interfaces file and it DOES work, but it is NOT persistent after the reboot and it, for some reason, still gets assigned a DHCP address.

Why doesn't the /etc/network/interfaces persist after reboot? Should I create a new file in the /etc/network/interfaces.d/ directory? I can't disable DHCP on our network. This is just not an option.

Andy

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

Re: How to set static IP address(es)? What am I doing wrong?

#7 Post by Aki »

Hello,
Andy wrote: 2024-06-24 18:34 I CAN use the /etc/network/interfaces file and it DOES work, but it is NOT persistent after the reboot and it, for some reason, still gets assigned a DHCP address.
There is probably more than one network configuration service running at the same time.

Can you please post your /etc/network/interfaces ?

Can you please post files in /etc/network/interfaces.d/ directory (if any) ?

Can you please post the system log ? You can do it with the following command:

Code: Select all

script log.txt
sudo journalctl -b --no-pager
exit
The system log will be in log.txt

You can report logs in one of the following ways:
  • attaching the logs to a follow-up forum message as a compressed zip or gz file
  • paste logs into the body of a follow-up message between code tags (if they fit the size of a forum message)
Hope this helps.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#8 Post by Andy »

I have attached the log file and here's my interfaces file:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

#The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.1.190/24
gateway 192.168.1.1

allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.1.191/24
gateway 192.168.1.1

Thank you for your help!

Andy

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

Re: How to set static IP address(es)? What am I doing wrong?

#9 Post by Aki »

Hello,

System logs are not attached.

Why did you assigned two IP addresses to the same network interface ?

--
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
⠈⠳⣄⠀

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#10 Post by Andy »

I want at least 2 IP addresses assigned. I will probably assign more later, IF I can figure out what I'm doing wrong!

:)

I followed these instructions (see below) to attach the requested file(s):

Code: Select all

script log.txt
sudo journalctl -b --no-pager
exit
Is that wrong? How do I provide the log(s) you're looking for?

Andy

CwF
Global Moderator
Global Moderator
Posts: 3073
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 63 times
Been thanked: 254 times

Re: How to set static IP address(es)? What am I doing wrong?

#11 Post by CwF »

Andy wrote: 2024-06-24 22:01 I want at least 2 IP addresses assigned.
Why?

You can have multiple vm's on one physical eth, each with its own ip - assigned within the vm, and an ip for the host.

Once there is an explanation for using two static ip's for a single interface within a given OS I would rephrase my question to; Why?
Mottainai

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#12 Post by Andy »

Because I create multiple NGinx websites on the same VM. Each with its own static IP address.

Andy

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#13 Post by Andy »

I have made a discovery.

Here is my /etc/network/interfaces file:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s3

iface enp0s3 inet static
    address 192.168.1.190/24
    gateway 192.168.1.1

#iface enp0s3 inet static
    address 192.168.1.191/24
    gateway 192.168.1.1
When I reboot the VM and log in, if I issue the simple command:

Code: Select all

ip -c a
I still ONLY see the DHCP assigned address, for some odd reason.

However, if I then issue the command:

Code: Select all

systemctl restart networking
I DO see my static IP addresses 192.168.1.190, 192.168.1.191 AND the formerly DHCP assigned address of 192.168.1.171

Why does restarting the networking service seem to make my static IP addresses appear? It's like something is getting initialized before parsing the "interfaces" file.

Thoughts?

Thank you,
Andy

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#14 Post by Andy »

I discovered something else.

If my interfaces file syntax is changed from

Code: Select all

auto enp0s3
to

Code: Select all

allow-hotplug enp0s3
and then I issue the

Code: Select all

systemctl restart networking
command, the formerly assigned DHCP assigned IP address finally disappears. BUT...my static IP addresses still do not appear on boot as one would expect.

Thoughts? Suggestions?

Andy

CwF
Global Moderator
Global Moderator
Posts: 3073
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 63 times
Been thanked: 254 times

Re: How to set static IP address(es)? What am I doing wrong?

#15 Post by CwF »

I would think some other mechanism is still active, hopefully not a 'vboxism'

Check journal maybe after a fresh boot before anything else

Code: Select all

$ journalctl -g dhcp
Mottainai

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#16 Post by Andy »

Here's the results of your command after a reboot:

Code: Select all

Jun 25 07:12:04 debian audit[508]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=508 comm="apparmor_parser"
Jun 25 07:12:04 debian kernel: audit: type=1400 audit(1719324724.583:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=508 comm="apparmor_parser"
Jun 25 07:12:04 debian kernel: audit: type=1400 audit(1719324724.583:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=508 comm="apparmor_parser"
Jun 25 07:12:04 debian audit[508]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=508 comm="apparmor_parser"
Jun 25 07:12:10 debian dhclient[559]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:12:10 debian sh[559]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:12:10 debian sh[559]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:12:10 debian dhclient[559]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:12:11 debian sh[559]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 8
Jun 25 07:12:11 debian dhclient[559]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 8
Jun 25 07:12:14 debian dhclient[559]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:12:14 debian sh[559]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:12:14 debian sh[559]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:12:14 debian dhclient[559]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:12:14 debian dhclient[559]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 07:12:14 debian sh[559]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot 30c92fa60c174d28aadbaa3445f3ccaf --
Jun 25 07:19:46 debian audit[506]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=506 comm="apparmor_parser"
Jun 25 07:19:46 debian audit[506]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=506 comm="apparmor_parser"
Jun 25 07:19:46 debian kernel: audit: type=1400 audit(1719325186.239:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=506 comm="apparmor_parser"
Jun 25 07:19:46 debian kernel: audit: type=1400 audit(1719325186.239:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=506 comm="apparmor_parser"
Jun 25 07:19:47 debian dhclient[589]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:19:47 debian sh[589]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:19:47 debian sh[589]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:19:47 debian dhclient[589]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:19:47 debian sh[589]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7
Jun 25 07:19:47 debian dhclient[589]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7
Jun 25 07:19:47 debian dhclient[589]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:19:47 debian sh[589]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:19:47 debian sh[589]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:19:47 debian dhclient[589]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:19:47 debian dhclient[589]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 07:19:47 debian sh[589]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot a9578eecf7344f4987d0364ebf7a4e4d --
Jun 25 07:22:31 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 07:22:31 debian kernel: audit: type=1400 audit(1719325351.111:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 07:22:31 debian kernel: audit: type=1400 audit(1719325351.111:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
Jun 25 07:22:31 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
Jun 25 07:22:32 debian dhclient[543]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:22:32 debian sh[543]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:22:32 debian sh[543]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:22:32 debian dhclient[543]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:22:32 debian sh[543]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7
Jun 25 07:22:32 debian dhclient[543]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7
Jun 25 07:22:32 debian dhclient[543]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:22:32 debian sh[543]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:22:32 debian sh[543]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:22:32 debian dhclient[543]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:22:32 debian dhclient[543]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 07:22:32 debian sh[543]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot 6cf0e73d22504166b35b2de3cb91ab33 --
Jun 25 07:32:02 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 07:32:02 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
Jun 25 07:32:02 debian kernel: audit: type=1400 audit(1719325922.107:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 07:32:02 debian kernel: audit: type=1400 audit(1719325922.107:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
Jun 25 07:32:03 debian dhclient[557]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:32:03 debian sh[557]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 07:32:03 debian sh[557]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:32:03 debian dhclient[557]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 07:32:04 debian sh[557]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7
Jun 25 07:32:04 debian dhclient[557]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7
Jun 25 07:32:04 debian dhclient[557]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:32:04 debian sh[557]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 07:32:04 debian sh[557]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:32:04 debian dhclient[557]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 07:32:04 debian dhclient[557]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 07:32:04 debian sh[557]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot 80c1ff2434d241b8a19fd4284cc2af5b --
Jun 25 08:15:17 debian audit[501]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=501 comm="apparmor_parser"
Jun 25 08:15:17 debian audit[501]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=501 comm="apparmor_parser"
Jun 25 08:15:17 debian kernel: audit: type=1400 audit(1719328517.755:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=501 comm="apparmor_parser"
Jun 25 08:15:17 debian kernel: audit: type=1400 audit(1719328517.755:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=501 comm="apparmor_parser"
Jun 25 08:15:19 debian dhclient[551]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:15:19 debian sh[551]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:15:19 debian sh[551]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:15:19 debian dhclient[551]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:15:19 debian sh[551]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 8
Jun 25 08:15:19 debian dhclient[551]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 8
Jun 25 08:15:19 debian dhclient[551]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:15:19 debian sh[551]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:15:19 debian sh[551]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:15:19 debian dhclient[551]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:15:19 debian dhclient[551]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 08:15:19 debian sh[551]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot 38ca21e42ca44054a298f29d3e95fe04 --
Jun 25 08:18:45 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 08:18:45 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 08:18:45 debian kernel: audit: type=1400 audit(1719328725.951:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 08:18:45 debian kernel: audit: type=1400 audit(1719328725.951:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 08:18:47 debian dhclient[538]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:18:47 debian sh[538]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:18:47 debian sh[538]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:18:47 debian dhclient[538]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:18:47 debian sh[538]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 5
Jun 25 08:18:47 debian dhclient[538]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 5
Jun 25 08:18:47 debian dhclient[538]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:18:47 debian sh[538]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:18:47 debian sh[538]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:18:47 debian dhclient[538]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:18:47 debian dhclient[538]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 08:18:47 debian sh[538]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot ca57e8bd2a38412f86e1e2dd40771849 --
Jun 25 08:42:02 debian kernel: audit: type=1400 audit(1719330122.447:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=501 comm="apparmor_parser"
Jun 25 08:42:02 debian kernel: audit: type=1400 audit(1719330122.447:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=501 comm="apparmor_parser"
Jun 25 08:42:02 debian audit[501]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=501 comm="apparmor_parser"
Jun 25 08:42:02 debian audit[501]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=501 comm="apparmor_parser"
Jun 25 08:42:03 debian dhclient[541]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:42:03 debian sh[541]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:42:03 debian sh[541]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:42:03 debian dhclient[541]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:42:04 debian sh[541]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 5
Jun 25 08:42:04 debian dhclient[541]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 5
Jun 25 08:42:04 debian dhclient[541]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:42:04 debian sh[541]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:42:04 debian sh[541]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:42:04 debian dhclient[541]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:42:04 debian dhclient[541]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 08:42:04 debian sh[541]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot efa172564aa14e639a6c821236f45e98 --
Jun 25 08:49:01 debian kernel: audit: type=1400 audit(1719330540.787:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 08:49:01 debian kernel: audit: type=1400 audit(1719330540.787:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 08:49:00 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 08:49:00 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 08:49:02 debian sh[542]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:49:02 debian sh[542]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:49:02 debian dhclient[542]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:49:02 debian dhclient[542]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:49:03 debian sh[542]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3
Jun 25 08:49:03 debian dhclient[542]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3
Jun 25 08:49:03 debian dhclient[542]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:49:03 debian sh[542]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:49:03 debian sh[542]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:49:03 debian dhclient[542]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:49:03 debian dhclient[542]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 08:49:03 debian sh[542]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot 03d4d29f98c449f28a1b37311c30727a --
Jun 25 08:52:46 debian kernel: audit: type=1400 audit(1719330765.375:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 08:52:46 debian kernel: audit: type=1400 audit(1719330765.375:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 08:52:45 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 08:52:45 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 08:52:46 debian dhclient[538]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:52:46 debian sh[538]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 25 08:52:46 debian sh[538]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:52:46 debian dhclient[538]: For info, please visit https://www.isc.org/software/dhcp/
Jun 25 08:52:47 debian sh[538]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3
Jun 25 08:52:47 debian dhclient[538]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3
Jun 25 08:52:47 debian dhclient[538]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:52:47 debian sh[538]: DHCPOFFER of 192.168.1.173 from 192.168.1.1
Jun 25 08:52:47 debian sh[538]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:52:47 debian dhclient[538]: DHCPREQUEST for 192.168.1.173 on enp0s3 to 255.255.255.255 port 67
Jun 25 08:52:47 debian dhclient[538]: DHCPACK of 192.168.1.173 from 192.168.1.1
Jun 25 08:52:47 debian sh[538]: DHCPACK of 192.168.1.173 from 192.168.1.1
-- Boot 030ec8711c67431f9acd35d03cad8ec5 --
Jun 25 09:43:07 debian audit[503]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=503 comm="apparmor_parser"
Jun 25 09:43:07 debian kernel: audit: type=1400 audit(1719333787.571:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=503 comm="apparmor_parser"
Jun 25 09:43:07 debian kernel: audit: type=1400 audit(1719333787.571:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=503 comm="apparmor_parser"
Jun 25 09:43:07 debian audit[503]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=503 comm="apparmor_parser"
-- Boot 3248122c19e349219f99f24fcbf2f63b --
Jun 25 10:06:57 debian kernel: audit: type=1400 audit(1719335216.291:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=503 comm="apparmor_parser"
Jun 25 10:06:57 debian kernel: audit: type=1400 audit(1719335216.291:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=503 comm="apparmor_parser"
Jun 25 10:06:56 debian audit[503]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=503 comm="apparmor_parser"
Jun 25 10:06:56 debian audit[503]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=503 comm="apparmor_parser"
-- Boot 6f622ac579ab45aa9e0e1d5b20cfddd5 --
Jun 25 10:11:57 debian kernel: audit: type=1400 audit(1719335516.523:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 10:11:57 debian kernel: audit: type=1400 audit(1719335516.523:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
Jun 25 10:11:56 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 10:11:56 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
-- Boot 9071a05614f04e0ba8dcfb8038dbe110 --
Jun 25 10:30:26 debian kernel: audit: type=1400 audit(1719336625.255:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=505 comm="apparmor_parser"
Jun 25 10:30:26 debian kernel: audit: type=1400 audit(1719336625.255:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=505 comm="apparmor_parser"
Jun 25 10:30:25 debian audit[505]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=505 comm="apparmor_parser"
Jun 25 10:30:25 debian audit[505]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=505 comm="apparmor_parser"
-- Boot 2cde92de4987434b8bc43d868335250e --
Jun 25 10:33:39 debian kernel: audit: type=1400 audit(1719336818.599:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 10:33:39 debian kernel: audit: type=1400 audit(1719336818.599:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 10:33:38 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 10:33:38 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
-- Boot 76ea4f04894b4dff994c5a6cc00033ad --
Jun 25 10:39:34 debian kernel: audit: type=1400 audit(1719337174.071:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=503 comm="apparmor_parser"
Jun 25 10:39:34 debian kernel: audit: type=1400 audit(1719337174.071:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=503 comm="apparmor_parser"
Jun 25 10:39:34 debian audit[503]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=503 comm="apparmor_parser"
Jun 25 10:39:34 debian audit[503]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=503 comm="apparmor_parser"
-- Boot 2f5e3cf907d54f8e8efe2e5cb00c4083 --
Jun 25 10:42:50 debian kernel: audit: type=1400 audit(1719337369.503:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=500 comm="apparmor_parser"
Jun 25 10:42:50 debian kernel: audit: type=1400 audit(1719337369.503:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=500 comm="apparmor_parser"
Jun 25 10:42:49 debian audit[500]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=500 comm="apparmor_parser"
Jun 25 10:42:49 debian audit[500]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=500 comm="apparmor_parser"
-- Boot 76379364bad94a1cb5f87d3602ea4f54 --
Jun 25 10:50:35 debian audit[500]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=500 comm="apparmor_parser"
Jun 25 10:50:35 debian audit[500]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=500 comm="apparmor_parser"
-- Boot 8417889b3b8a41f396e6b5c470fe4bb1 --
Jun 25 12:55:46 debian kernel: audit: type=1400 audit(1719345345.571:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 12:55:46 debian kernel: audit: type=1400 audit(1719345345.571:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Jun 25 12:55:45 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=502 comm="apparmor_parser"
Jun 25 12:55:45 debian audit[502]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=502 comm="apparmor_parser"
Thank you for your thoughts!

Andy

CwF
Global Moderator
Global Moderator
Posts: 3073
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 63 times
Been thanked: 254 times

Re: How to set static IP address(es)? What am I doing wrong?

#17 Post by CwF »

Apparently the '-g dhcp' part didn't filter the output...

It clearly shows networkmanager is still installed and active.
Mottainai

CwF
Global Moderator
Global Moderator
Posts: 3073
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 63 times
Been thanked: 254 times

Re: How to set static IP address(es)? What am I doing wrong?

#18 Post by CwF »

Andy wrote: 2024-06-25 20:01 Here's the results of your command after a reboot:
Not really 'mine'
In the future try to include the prompt and command in the code block.

Code: Select all

$ journalctl -g dhcp
Nov 20 00:18:51 forums dhclient[346]: DHCPREQUEST for 192.168.1.100 on eth0
Mottainai

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

Re: How to set static IP address(es)? What am I doing wrong?

#19 Post by Aki »

Hello @Andy,

As @CwF pointed out, the NetworkManager service is running and it starts in the dhcp client:

Code: Select all

Jun 25 07:32:02 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=504 comm="apparmor_parser"
Jun 25 07:32:02 debian audit[504]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=504 comm="apparmor_parser"
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Andy
Posts: 13
Joined: 2024-06-23 13:44

Re: How to set static IP address(es)? What am I doing wrong?

#20 Post by Andy »

Thank you.

This is a clean installation of Debian 12 in which I have installed nothing. I'm not sure why "NetworkManager" is running because I have not installed it. After the base installation, the very first thing I have tried to do is set up static IP addressing.

Coincidentally, when I run the command

Code: Select all

apt-get install network-manager
...the package installs. Is that, somehow, different than the NetworkManager that seems to be installed by default?....I just don't know.

How do I neuter the NetworkManager that is installed by default?...I don't know that either.

Andy

Post Reply