3

I am attempting to setup a WiFi network with dnsmasq on ArchLinux where I have NetworkManager and iproute2 (not net-tools anymore in ArchLinux).

As I am reading some tutorials they offen refer to /etc/network/interfaces when setting up static ip for the wifi network interface. Is this file relevant also on systems with net-tools or should I use iproute2 CLI to setup the static ip address ?

ps-aux
  • 3,715
  • 5
  • 29
  • 40

2 Answers2

7

Both iproute2 and net-tools' ifconfig are low-level tools which can change all the settings directly but don't have any sort of persistent configuration file.

The interfaces file is used by "ifupdown", a higher-level network setup tool which only exists on Debian and derivatives – not on Arch Linux. (Behind the scenes it does use either iproute2 or ifconfig, but that doesn't change anything.)

  • The most similar package on Arch would be netctl, although it's a bit flimsy.
  • Of course, since you already have NetworkManager installed, you could just use that – but on the other hand it might interfere with setting up a Wi-Fi network. (Unless you use NM's built-in hotspot function...) The configuration can be managed via nmcli; see also nm-settings(5).
  • The other alternative, which comes with Arch, is systemd-networkd – it's simple to configure (see the systemd.network(5) manual) but its networkctl tool is serverely lacking. It does the job fine if you want an interface to be configured all the time, though.
  • For more complex configurations, you might have to write your own script (usually a Type=oneshot systemd service) which directly calls the ip and iw tools and configures everything.
u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
3

AFAIK /etc/network/interfaces is mainly a Debian and descendants thing. I don't have that folder on any of my arch machines.

I'm assuming you're not talking about WiFi here. If you are, have a look at netctl or systemd-networkd.

Assuming you want static configuration, create /etc/systemd/network/50-wired.network with the following content (changing Name, Address and Gatway according to your network, of course): [Match] Name=enp1s0 [Network] Address=10.1.10.9/24 Gateway=10.1.10.1

Disable NetworkManager:

# systemctl stop NetworkManager.service

# systemctl disable NetworkManager.service

Enable and start systemd-networkd.service:

# systemctl start systemd-networkd.service

# systemctl enable systemd-networkd.service

After you have configured dnsmasq to do what you wanted it to, you activate and start it:

# systemctl start dnsmasq.service

# systemctl enable dnsmasq.service

PaterSiul
  • 339
  • 1
  • 8