netctlの設定

Arch Linuxではネットワークツールとしてnetctlが推奨されているので、その設定のメモ。

GNOMEを使う場合はnetctlを無効にしてNetworkManagerを使う。

設定ファイルの場所が/etc/netctl

設定のサンプルが/etc/netctl/examplesにあるので、/etc/netctlにコピーして使う。

examplesの中身は
$ ls /etc/netctl/examples
bonding macvlan-dhcp tunnel wireless-wep
bridge macvlan-static tuntap wireless-wpa
ethernet-custom mobile_ppp vlan-dhcp wireless-wpa-config
ethernet-dhcp openvswitch vlan-static wireless-wpa-configsection
ethernet-static pppoe wireless-open wireless-wpa-static

 

DHCPサーバからIPを取得するには ethernet-dhcp をコピーする。コピー先の名前はなんでも良い。
$ sudo cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/

 

dhcpならそのままで良いが、PPPoEやWifi、ブリッジなどでは環境に合わせて設定が必要。

vimなどでファイルを開くと設定のサンプルが書いてあるので、NICやIPなど必要なところだけ変更すれば大丈夫。







有効化

$ sudo netctl start ethernet-dhcp

または、systemctlからは
$ sudo systemctl start netctl@ethernet-dhcp









起動時に有効化


ethernet-dhcpを有効にする場合は、

$ sudo netctl enable ethernet-dhcp

または、systemctlから
$ sudo systemctl enable netctl@ethernet-dhcp

 

netctlでもsystemctlでもやっていることは同じで、 /etc/systemd/system に service ファイルが作成されます。

 

コメント

このブログの人気の投稿

fontconfigの設定

VLCでBlu-rayを再生

UEFIのブートオーダーを一時的に変更する