Skip to content

Instantly share code, notes, and snippets.

@hagevvashi
Last active January 22, 2023 13:34
Show Gist options
  • Save hagevvashi/b8505195728f4ea7f5ced29487104c98 to your computer and use it in GitHub Desktop.
Save hagevvashi/b8505195728f4ea7f5ced29487104c98 to your computer and use it in GitHub Desktop.
ubuntu server で wifi 動かすまで

インストールした順番

  1. libpcsclite1_1.9.1-1_amd64.deb

  2. libnl-3-200_3.4.0-1+b1_amd64.deb

  3. libnl-route-3-200_3.4.0-1+b1_amd64.deb

  4. wpasupplicant_2.9.0-21_amd64.deb

  5. net-tools_1.60+git20161116.90da8a0-1ubuntu1_amd64.deb

ここまでで事前準備終了

次は wpa_supplicant の設定

sudo wpa_passphrase <ssid> [passphrase] > $HOME/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root

#ap_scan=1
network={
    ssid="your-ssid"
    #psk="your-pass"
    psk="your-pass-encrypted"
    key_mgmt=WPA-PSK
    proto=WPA WPA2
    pairwise=CCMP TKIP
    group=CCMP TKIP WEP104 WEP40
}

起動

sudo wpa_supplicant -Dwext -iwlp2s0 -c/home/<user>/wpa_supplicant.conf -B

apt で依存関係修復をしたら色々おかしくなった

で、インストールしたもの

  1. libnl-genl-3-200_3.4.0-1+b1_amd64.deb
  2. firmware-iwlwifi_20190114-2_all.deb https://packages.debian.org/search?keywords=firmware-iwlwifi ここから stable をダウンロード

2 のインストールコマンド

sudo dpkg -i --force-overwrite firmware-iwlwifi_20190114-2_all.deb

わかっていること

下記コマンドでネットワークインターフェースの状態を確認

sudo  lshw -class network
  *-network UNCLAIMED
      description: Ethernet controller
      ...

UNCLAIMEDと表示されているためドライバが認識されていなさそう

下記コマンドでPCIデバイスの情報を表示する

lspci
02:00.0 Ethernet Controller: Marvell Technology Group Ltd. 88W8897 [AVASTAR] 802.11ac Wireless

という表記が見て取れるので、この88W8897のドライバをインストールすればよい

surface laptop のデバイス/ドライバ一覧

http://linux-hardware.org/index.php?probe=76e652c78c

解決

ubuntu server のインストールから wpasupplicant 起動後以降の手順どおりにする

https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup

※この手順で linux-surface にカーネルを書き換ずにapt updateをした場合、wifiのドライバが消えるので要注意

netplan の設定

wlp2s0 が起動時に有効になっていないのでその設定

https://blog.d-shimizu.io/article/1196

https://qiita.com/zen3/items/757f96cbe522a9ad397d

https://blog.kujira-station.com/201910232379

ここに従うとよい。(ipの固定化はまだしてない)

ファイル名は 2 つ目の記事に従い、/etc/netplan/99_config.ymal とかがよい

下記のような感じで設定してうまくいった。

/etc/netplan/99_config.yaml

network:
        wifis:
                wlp2s0:
#                         optional: true
                        dhcp4: true
#                         dhcp6: true
                        access-points:
                                "ACCESS_POINT":
                                        password: "********"
        version: 2
        renderer: networkd

pass phrase は上の方の手順で行った sudo wpa_passphrase <ssid> [passphrase] で生成したものを指定

あとは下記のようにコマンド実行していった

sudo netplan generate # 多分これ不要
sudo netplan apply
sudo systemctl disable networking
sudo systemctl enable systemd-networkd.service
sudo reboot
@hagevvashi
Copy link
Author

arp proxyとdhcp relayの概念図はこれが参考になる RasberryPI の例だけど

https://zenn.dev/masebb/articles/cc8b1151be73fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment