4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Arch Linuxで固定IPを簡単に設定する

Posted at

あまり情報がなかったので、メモしておく。

想定している環境

  • 有線LAN。ただし無線でもあまり変わらないはず。
  • Netctlを使う。これが一番簡単。
  • DHCPで既にネットにはつなげている。

手順

Netctlの設定ファイルを作成

Interface名はip aコマンドの出力を見て確認する。
自分の場合はenp2s0だった。

sudo vim /etc/netctl/enp2s0

/etc/netctl/enp2s0
Description='A basic static ethernet connection'
Interface=enp2s0
Connection=ethernet
IP=static
Address=('192.168.25.219')
Gateway='192.168.24.254'
DNS=('192.168.4.10', '192.168.4.12')

DHCPCDの停止

sudo systemctl stop dhcpcd.service
sudo systemctl disable dhcpcd.service

Netctlを自動起動

sudo systemctl start netctl.service
sudo systemctl enable netctl.service

sudo systemctl start netctl@enp2s0
sudo systemctl enable netctl@enp2s0

参考

4
5
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?