Skip to content

Instantly share code, notes, and snippets.

@f440 f440/Memo.md
Last active Jun 15, 2018

Embed
What would you like to do?
systemd-networkd の設定 (Thinkpad T470s)

ネットワーク設定, ワイヤレス設定, WPA supplicant, systemd-networkd, systemd-resolved

# 以前作ったnetctlの設定を削除
sudo systemctl stop netctl-auto@wlp58s0.service
sudo systemctl disable netctl-auto@wlp58s0.service

sudo -e /etc/systemd/network/wired.network
    
    [Match]
    Name=enp0s31f6 ## Which interface to use
    
    [Network]
    DHCP=ipv4 ## DHCP type, use ‘yes’ for both ipv4 and ipv6
    
    [DHCP]
    RouteMetric=10 ## Priority of this connection, lower number = bigger priority
    
sudo -e /etc/systemd/network/wireless.network
    
    [Match]
    Name=wlp58s0
    
    [Network]
    DHCP=ipv4
    
    [DHCP]
    RouteMetric=20
    
sudo systemctl enable systemd-networkd
sudo systemctl start systemd-networkd
    
sudo mv /etc/resolve.conf /etc/resolve.conf.bak
sudo systemctl enable systemd-resolved
sudo systemctl start systemd-resolved
# ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf するように指示するネット記事が散見されるけど、勝手に /usr/lib/systemd/resolv.conf -> /etc/resolv.conf が作られる
    
sudo -e /etc/wpa_supplicant/wpa_supplicant-wlp58s0.conf

    ctrl_interface=/run/wpa_supplicant
    ctrl_interface_group=wheel
    update_config=1
    
sudo chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlp58s0.conf

wpa_passphrase $SSID $PASSPHRASE | sudo tee -a /etc/wpa_supplicant/wpa_supplicant-wlp58s0.conf

sudo systemctl enable wpa_supplicant@wlp58s0
sudo systemctl start wpa_supplicant@wlp580s0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.