3

I have two servers with Archlinux.

Both of them are using static IP address with netctl. Both of them are accessed only with ssh (e.g. I have no keyboard and monitor).

Problem I facing is when server boot, if the network cable is unplugged, the IP address is not set up.

I tried with ExcludeAuto=no and with ForceConnect=yes, but no success.

I tried with ifplugd as well, but it does my server inaccessible so I did not test much.

I know I can probably do it with ip link or ifconfig directly, but I am looking for some more intelligent solution.

Configuration looks like this:

# /etc/netctl/lan1 

Description='A basic static ethernet connection'
Interface=enp1s0
Connection=ethernet
IP=static
Address=('192.168.0.3/24')
Gateway='192.168.0.1'
DNS=('8.8.8.8')
5
  • can you include the configuration of the interfaces in /etc/network/interfaces
    – Jimmy_A
    May 30 '17 at 8:40
  • there is no such file. just /etc/netctl/lan1
    – Nick
    May 30 '17 at 11:07
  • yeah, I was still thinking of Linux. Update your question with the configuration of your interface, there might be something missing
    – Jimmy_A
    May 30 '17 at 11:11
  • done, updated...
    – Nick
    May 30 '17 at 12:40
  • The configuration seems fine. You said you tried using ifplugd which would be able to solve your issue. Can you try restarting netctl with the interface down the first time and then up if that doesn't work? Also, maybe there is another network manager installed that conflicts with the configuration
    – Jimmy_A
    May 30 '17 at 13:12
3

I checked netctl source code and found I need to add following lines into netctl profile:

ForceConnect=yes
SkipNoCarrier=yes

e.g. full profile must be something like this:

# /etc/netctl/lan1 

Description='A basic static ethernet connection'
Interface=enp1s0
Connection=ethernet
IP=static
Address=('192.168.0.3/24')
Gateway='192.168.0.1'
DNS=('8.8.8.8')

ForceConnect=yes
SkipNoCarrier=yes

if you search google for SkipNoCarrier=yes, you can find it online, but it is still not well documented on Archlinux website.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.