You are not logged in.

#1 2020-04-18 01:17:54

ThePatcher
Member
Registered: 2020-04-15
Posts: 5

Static IP Address for VM interface

I try to add a static IP address to my enp0s3 interface in my fresh installed Arch. I tried to simply copy and change the example file in /etc/netctl/examples/ethernet-static as mentioned in Wiki-Netctl.
This is my profile

/etc/netctl/enp0s3
Description='A basic static ethernet connection'
Interface=enp0s3
Connection=ethernet
IP=static
Address=('192.168.1.120/24')
Gateway='192.168.1.1'
DNS=('8.8.8.8' '8.8.4.4')
ForceConnect=yes

## For IPv6 autoconfiguration
#IP6=stateless

## For IPv6 static address configuration
#IP6=static
#Address6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#Routes6=('abcd::1234')
#Gateway6='1234:0:123::abcd'

in the beginning my enp0s3 interfaces looks like this

2: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 08:00:27:be:fa:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.110/24 brd 192.168.1.255 scope global enp0s3
       valid_lft forever preferred_lft forever

it has one static IP from the last time i tried to change the ip but it isn't up. If i try to change the IP adress by doing

netctl start enp0s3

the netctl@enp0s3.service deamon fails and hast this status

netctl@enp0s3.service - A basic static ethernet connection
     Loaded: loaded (/usr/lib/systemd/system/netctl@.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/netctl@enp0s3.service.d
             └─profile.conf
     Active: failed (Result: exit-code) since Sat 2020-04-18 03:01:04 CEST; 34s ago
       Docs: man:netctl.profile(5)
    Process: 432 ExecStart=/usr/lib/netctl/network start enp0s3 (code=exited, status=1/FAILURE)
   Main PID: 432 (code=exited, status=1/FAILURE)

Apr 18 03:01:03 asalpha systemd[1]: Starting A basic static ethernet connection...
Apr 18 03:01:03 asalpha network[432]: Starting network profile 'enp0s3'...
Apr 18 03:01:04 asalpha systemd[1]: Started A basic static ethernet connection.
Apr 18 03:01:04 asalpha network[445]: Failed to set DNS configuration: Unit dbus-org.freedesktop.resolve1.service not found.
Apr 18 03:01:04 asalpha systemd[1]: netctl@enp0s3.service: Got notification message from PID 445, but reception only permitted for main PID 432
Apr 18 03:01:04 asalpha network[432]: Failed to bring the network up for profile 'enp0s3'
Apr 18 03:01:04 asalpha systemd[1]: netctl@enp0s3.service: Main process exited, code=exited, status=1/FAILURE
Apr 18 03:01:04 asalpha systemd[1]: netctl@enp0s3.service: Failed with result 'exit-code'.
 

I have severel questions here:
1) is my enp0s3 file correct or did i change something wrong?
2) Do how can i stop netctl from failing

Last edited by ThePatcher (2020-04-18 01:18:59)

Offline

#2 2020-04-18 03:05:00

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Static IP Address for VM interface

You don't need to enable netctl@enp0s3, just the netctl.service unit. You enabled the profile with the 'netctl enable' command.

Offline

#3 2020-04-18 03:10:22

ThePatcher
Member
Registered: 2020-04-15
Posts: 5

Re: Static IP Address for VM interface

fukawi2 wrote:

You don't need to enable netctl@enp0s3, just the netctl.service unit. You enabled the profile with the 'netctl enable' command.

So what exactly should I do?
just create the Profile and then do

systemctl enable netctl 
reboot

and then it should work?

Last edited by ThePatcher (2020-04-18 03:10:56)

Offline

#4 2020-04-18 03:12:33

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Static IP Address for VM interface

systemctl enable netctl 
netctl enable your_profile_name
netctl start your_profile_name

Make sure netctl is the only network management tool you have enabled too.

Offline

#5 2020-04-18 03:20:48

ThePatcher
Member
Registered: 2020-04-15
Posts: 5

Re: Static IP Address for VM interface

So now, it sets the IP-Address I chose, but still fails to bring the network interface up with nearly the same PID error.
I can set the interface state to "up" manually with

ip link set enp0s3 up 

but i feel like i shouldn't have to do that...

Last edited by ThePatcher (2020-04-18 03:21:13)

Offline

#6 2020-04-18 03:32:34

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Static IP Address for VM interface

Why do you have ForceConnect=yes?

What is the output of `netctl status enp0s3`?

Offline

#7 2020-04-18 03:41:53

ThePatcher
Member
Registered: 2020-04-15
Posts: 5

Re: Static IP Address for VM interface

Force Connect=yes is set because i tried to apply the troubleshooting from the Wiki-Netctl/Troubleshooting
The output ist:

 netctl status enp0s3
---------------------------------------------------------------------------------------------------
netctl@enp0s3.service - A basic static ethernet connection
     Loaded: loaded (/usr/lib/systemd/system/netctl@.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/netctl@enp0s3.service.d
             └─profile.conf
     Active: failed (Result: exit-code) since Sat 2020-04-18 05:34:41 CEST; 3min 57s ago
       Docs: man:netctl.profile(5)
    Process: 372 ExecStart=/usr/lib/netctl/network start enp0s3 (code=exited, status=1/FAILURE)
   Main PID: 372 (code=exited, status=1/FAILURE)

Apr 18 05:34:41 asalpha systemd[1]: Starting A basic static ethernet connection...
Apr 18 05:34:41 asalpha network[372]: Starting network profile 'enp0s3'...
Apr 18 05:34:41 asalpha systemd[1]: Started A basic static ethernet connection.
Apr 18 05:34:41 asalpha network[385]: Failed to set DNS configuration: Unit dbus-org.freedesktop.resolve1.service not found.
Apr 18 05:34:41 asalpha systemd[1]: netctl@enp0s3.service: Got notification message from PID 385, but reception only permitted for main PID 372
Apr 18 05:34:41 asalpha network[372]: Failed to bring the network up for profile 'enp0s3'
Apr 18 05:34:41 asalpha systemd[1]: netctl@enp0s3.service: Main process exited, code=exited, status=1/FAILURE
Apr 18 05:34:41 asalpha systemd[1]: netctl@enp0s3.service: Failed with result 'exit-code'.

Offline

#8 2020-04-18 03:46:55

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Static IP Address for VM interface

Apr 18 05:34:41 asalpha network[385]: Failed to set DNS configuration: Unit dbus-org.freedesktop.resolve1.service not found.
Apr 18 05:34:41 asalpha systemd[1]: netctl@enp0s3.service: Got notification message from PID 385, but reception only permitted for main PID 372

I'd be hunting down exactly what those errors are all about then....!

Offline

#9 2020-04-18 17:44:04

hleung
Member
Registered: 2011-01-10
Posts: 20
Website

Re: Static IP Address for VM interface

ThePatcher,

When you installed Arch Linux and started it up, did you enable dhcpcd.service before assigning the static IP?  Would it be possible to get the output of

systemctl list-unit-files --state=enabled

to see if you have other network managers running at the same time?


Everyone has their own belief, and that belief becomes their own religion.
My bible = "Rapture for the Geeks wink" by Richard Dooling

Offline

#10 2020-05-01 15:37:15

LycosIUT
Member
Registered: 2020-05-01
Posts: 1

Re: Static IP Address for VM interface

fukawi2 wrote:
Apr 18 05:34:41 asalpha network[385]: Failed to set DNS configuration: Unit dbus-org.freedesktop.resolve1.service not found.
Apr 18 05:34:41 asalpha systemd[1]: netctl@enp0s3.service: Got notification message from PID 385, but reception only permitted for main PID 372

I'd be hunting down exactly what those errors are all about then....!

The problem here is very explicit.

In your profile configuration, you specified the DNS.

From the Wiki-Netctl, if you specify DNS, then netctl will rely on resolvconf for the name resolution.

You have two options :

  • You want to keep the DNS specified in the profile. When you installed netctl, you had to chose between two implementations :  openresolv or systemd-resolvconf. If you chose the second one you just have to enable the associated service. (Can't tell for openresolv)

     systemctl enable --now systemd-resolved 
  • On the other hand, you can decide to rely on your resolv.conf file. Then you have to ensure that this file contains the right informations about the DNS you want and remove the DNS attribute from the profile configuration file.

Whether option you chose, restart the profile

 netctl restart <profile> 

Offline

Board footer

Powered by FluxBB