---
# System prepended metadata

title: WIFI相關設定
tags: [Linux]

---

# 建立 WIFI AP
## 設定方法
1. 安裝[create_ap](https://github.com/oblique/create_ap)
```shell
git clone https://github.com/oblique/create_ap
cd create_ap
make install
```
2. 設定WIFI AP的IP、名稱、密碼
```shell
sudo create_ap -n -g [IP] wlan0 [NAME] [PASSWORD] --mkconfig /etc/create_ap.conf
```
3. 設定開機自動啟動
```shell
sudo systemctl enable create_ap
```

## 異常排除
* ERROR: Failed to initialize lock
```shell
sudo rm /tmp/create_ap.all.lock
```

# 關閉wlan0
1. 加入設定至/etc/network/interfaces
```
iface wlan0 inet manual
```
2. 重啟網路設定
```shell
sudo service network-manager restart
```

# 更改網卡名稱
1. 將80-net-setup-link.rules從/lib/udev/rules.d/複製到/etc/udev/rules.d/：
```shell
sudo cp /lib/udev/rules.d/80-net-setup-link.rules /etc/udev/rules.d/
```
2. 修改80-net-setup-link.rules，將NAME="$env{ID_NET_NAME}"改成ID_NET_SLOT