1

I have installed Arch Linux on Virtual Box and am now in post installation setup, and I cannot establish my internet connection in order to download files using pacman, ping also does not work.

After reading the Wiki, I tried configuring a static ip for the ethernet interface, set up routing tables, and tried configuring /etc/systemd/network/enp0s3.network. Here are the outputs.

ip addr

iproute

Set systemd-networkd according to the wiki

$ cat /etc/systemd/network/enp0s3.network
[Match]
Name=enp0s3
[Network]
Address=192.168.4.44/24
Gateway=192.168.4.1
DNS=233.5.5.5

$ systemctl restart systemd-networkd
$ systemctl enable systemd-networkd

I have set the static IP to be 192.168.4.44 for the network interface and set up routing tables for it, but not completely sure if it is correct.

Before setting these options, I would get Temporary failure in name resolution right away. But after, it would take a while, then I would get the error.

I know that we can simply reattach the boot image, chroot from the live media and install the necessary utilities using pacstrap. But I want to learn how to do this without tools like DHCP, Network Manager, Netcl, only using ip and the tools already installed. So how can I configure my Arch Linux and set up a wired network connection properly?

P.S. The network for Virtual Box is Attached to: NAT

15
  • what device has the address 192.168.4.1? Commented Apr 26, 2023 at 2:06
  • I thought that is how we define the gateway value
    – akastack
    Commented Apr 26, 2023 at 2:15
  • yes, the gateway IP is the IP address usually of a router - you don't just make it up Commented Apr 26, 2023 at 2:43
  • In this case I am in a virtual box, what would the "router" be?
    – akastack
    Commented Apr 26, 2023 at 3:01
  • I have no knowledge of your networking environment - what's the gateway IP if you use DHCP instead of static, also, what is the Virtual Box host OS Commented Apr 26, 2023 at 4:04

1 Answer 1

0

After reading this I have figured out how to do it successfully.

Simply edit /etc/systemd/network/enp0s3.network

[Match]
Name=enp0s3
[Network]
DHCP=no
Address=10.0.2.5/24
Gateway=10.0.2.2
DNS=8.8.8.8

And restart

$ systemctl restart systemd-networkd
$ systemctl enable systemd-networkd

After that, ping successfully works! pacman -Syu also works.

You must log in to answer this question.

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