情境:
1. ubuntu server 20.04 僅提供 AP (access poing ) 存取
2. client 透過 ubuntu sever 向 core router 提出 dhcp 請求
首先確認 ubuntu 的 有線和無線網卡均可正常運作
安裝以下必要套件
# apt -y install hostapd
# apt -y install bridge-utils
編輯 hostapd 設定檔
# vi /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
hw_mode=g
channel=1
ieee80211d=1
country_code=TW
ieee80211n=1
wmm_enabled=1
ssid=AP-NAME
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=passwordddd
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
# vi /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
設定 netplan
# vi /etc/netplan/00-installer-config.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
wlan0:
dhcp4: no
bridges:
br0:
interfaces:
- eth0
- wlan0
addresses:
- 10.10.10.247/24
gateway4: 10.10.10.252
nameservers:
addresses: [10.10.10.26,8.8.8.8]
啟用 hostapd
# systemctl unmask hostapd
# systemctl start hostapd
最後找一台client 測試連線
留言列表