1

I've been trying to install Void Linux lately and couldn't get my network working. I don't use DHCP, I have static IP connection so I need to input all the information manually. I couldn't connect to the network during installation, it said that the network is just inaccessible. After installation I was following the official Void Linux instructions to configure my Static IP connection with /etc/dhcpcd.conf. I modified it with vi appending the following lines to the end:

interface enp7s0
static ip_address=192.168.165.30
static routers=192.168.165.29
static domain_name_servers=8.8.8.8

Using # ln -s /etc/sv/dhcpcd /var/service/ command didn't help, since link had already been created. It all didn't help, I could not ping any resource, there was 100% packet loss. I tried ping google.com and ping 8.8.8.8.

Trying to setup the network interface in the file /etc/rc.local via commands from the iproute package didn't allow me to use ping at all. I tried to modify it, appending the following lines:

ip link set dev enp7s0 up
ip addr add 192.168.165.30/24 brd + dev enp7s0
ip route add default via 192.168.165.29

I tried to do some debugging following the Arch Linux wiki, but it wasn't useful too.

The netmask suggested by my provider is 255.255.255.252 so do I use /30 somewhere?

How do I actually set up the Internet connection in my system?

  • 1
    Please provide specifics of what you have tried. Include the current settings from commands such as ip. Include the desired values. All this in your question, ideally as if you had added them in the first place (and then I can delete this comment). – roaima Jul 26 '17 at 23:21
  • @roaima I wrote what I actually have tried, didn't I? Not sure I need to include information like IP address, MAC-address and etc., so what's the point of including settings from the ip command and desired values? I can assure that I checked the values twice. ip a shows an available interface enp7s0 which I assigned values to. My dhcpcd.conf looks exactly same as in the Void Linux wiki example, except for personal values. – notEmissary Jul 26 '17 at 23:31
  • 1
    No, you haven't written what you tried. We can't see if you accidentally missed a step from the guide you've referenced, or maybe wrongly transformed a setting from the guide into your own situation. Clearly something isn't working because otherwise you wouldn't have needed to ask here. In order to help in this kind of situation we need the details. (Tweak them slightly if you need to do so, but make sure you understand exactly what you have changed and how it works impact the question/answer if you do this.) – roaima Jul 27 '17 at 6:36
  • @roaima I edited my question providing more detailed information. Do I need to add something more? – notEmissary Jul 27 '17 at 10:16
1

The difference between the installer instructions for a Static IP and your interpretation of them is slightly different and (unfortunately) very subtle.

Static IP configuration can [...] be done through dhcpcd and its configuration file /etc/dhcpcd.conf [...]. If an ethernet interface was configured at the installer, the dhcpcd.conf file should look as follows:

# Static IP configuration.
interface enp7s0
static ip_address=192.168.165.30/30
static routers=192.168.165.29
static domain_name_servers=8.8.8.8

The main difference is that you appended these lines to the end of your dhcpcd.conf file, whereas the instructions say that these should be the only things (uncommented) in your dhcpcd.conf file. Remove or comment everything else in the file and you should be on your way. Note that I've also added /30 to the ip_address definition because that's equivalent to your provider's recommendation of 255.255.255.252.

The guide goes on to say that alternatively, but not at the same time, you can remove the DHCP client and instead put lines in /etc/rc.local:

# Static IP configuration via iproute
ip link set dev enp7s0 up
ip addr add 192.168.165.30/30 brd + dev enp7s0
ip route add default via 192.168.165.29

You do not need both solutions.

I think that in your case, you had enough of the old dhcpcd.conf in place for the DHCP client to assume you wanted a dynamic address, so it prepared the interface but then found no answer from a DHCP server. The net result is an uninitialised interface.


I should point out these are generic suggestions, rather than ones specific to Void Linux, which I have never used.

  • Thank you for suggested solution but it didn't work out for me. I just tried commenting out everything except for Static IP configuration block in my dhcpcd.conf and rebooted my system. I'm still getting 100% packet loss, while pinging google.com – notEmissary Jul 27 '17 at 13:52
  • @notEmissary start with something closer. Can you ping your immediate upstream router, 192.168.165.29? Your local network is a /24 (255.255.255.0), isn't it? I see nothing in either the Guide or in your configuration that sets a netmask, whereas the man page suggests static ip_address=192.168.165.30/24 would be more correct. I'll update my answer... – roaima Jul 27 '17 at 14:05
  • @notEmissary is your DHCP client running (I know you put it in the runlevel, but it would be worth checking with ps -ef). – roaima Jul 27 '17 at 14:08
  • 1
    Thanks, I'll to go try it. The netmask suggested by my provider is 255.255.255.252 so I guess I better use /30, right? – notEmissary Jul 27 '17 at 14:13
  • I tried using both static ip_address=192.168.165.30/24 and static ip_address=192.168.165.30/30 (not at the same time) and none of them worked out for me. The ps -ef command says that dhcpcd is running. ping 192.168.165.29 was successfully done. There was no packet loss. – notEmissary Jul 27 '17 at 14:25

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.