5

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,815

2 Answers2

8

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 mostly exists on Debian and derivatives.

  • The most similar package on Arch would be ifupdown-ng, which seems to be an Alpine Linux project.

  • The most similar "Arch-native" thing would be netctl, although it's a bit flimsy. (And by the time you're reading it – probably obsolete.)

  • The other alternative, which comes with Arch, is systemd-networkd – see the systemd.network(5) manual.

  • Of course, since you already have NetworkManager installed, you could just use that. The configuration can be managed via nmcli or nmtui; see also nm-settings(5).

    However, NM might interfere with setting up a Wi-Fi network (unless you use NM's built-in hotspot function), although nmcli dev set <interface> managed no may help somewhat.

  • 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.

(Somewhat updated for 2025.)

grawity
  • 501,077
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