見出しにあるように、私はeth0とwlan0の間にブリッジを設定するなど、netplanを使用してアクセスポイントを設定する方法についての説明を探しています。 DHCPサーバーは、システムがeth0を介して接続されているルーターになります。 Ubuntu Server 18.04を実行しています。
(以前は、ifupdownとhostapdを使用して次の例で実行できましたが、現在はnetplanを使用する必要があります。)
- これにはどのパッケージをインストールする必要がありますか?
- yamlファイルを設定する以外に、何をする必要がありますか?
- ブリッジ(つまりbr0)はどこに定義されていますか?
- ssidやパスワードセットなどの資格情報はどこにありますか?
- 上記のシナリオのサンプルyamlファイル(つまり、eth0 wlan0)を共有できますか?
(私のシステムでは使用できないため、iptablesを使用しないソリューションが必要です)
私は専門家とはほど遠いので、指示が詳細であればあるほどよい…。
承認された回答:
私はこれらのリンクの助けを借りてそれを動作させました:1、2、3、4
これは私のために働いたシーケンスです(nモードのWiFi、静的IP):
- hostapdをインストールします:
apt-get update
、apt-get install hostapd
- マスクを解除して有効にする:
sudo systemctl unmask hostapd
、sudo systemctl enable hostapd
- /etc/hostapd/hostapd.confを作成し、切り取って貼り付けます:
# the interface used by the AP interface=wlan0 driver=nl80211 # "g" simply means 2.4GHz band hw_mode=g # the channel to use channel=1 # limit the frequencies used to those allowed in the country ieee80211d=1 # the country code country_code=DE # 802.11n support ieee80211n=1 # QoS support wmm_enabled=1 # the name of the AP ssid=yourSSID macaddr_acl=0 # 1=wpa, 2=wep, 3=both auth_algs=1 ignore_broadcast_ssid=0 # WPA2 only wpa=2 wpa_passphrase=yourpassphrase wpa_key_mgmt=WPA-PSK #wpa_pairwise=TKIP rsn_pairwise=CCMP
- ファイル/etc/ default / hostapdを編集し、DAEMON_CONFの行を次のように変更します:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
(APが表示されていることを確認するためのテスト、つまり電話:sudo service hostapd start
;次に、sudo service hostapd stop
もう一度セットアップを続行します)
- これを切り取って`/etc/netplan/network.yamlファイルに貼り付けます(タブなし、スペースのみ、インデントに正確に従う– yamlはうるさいです…):
network: version: 2 renderer: networkd ethernets: # My Ethernet adapter eth0: # For some reason it seems I must specify at least something here. dhcp4: no # My Wi-Fi adapter wlan0: dhcp4: no bridges: br0: interfaces: - eth0 - wlan0 # Using a static IP for this box. addresses: - 192.168.1.xxx/24 gateway4: 192.168.1.x nameservers: addresses: [1.1.1.1,1.0.0.1]
- 新しい構成を適用します:
sudo netplan generate
、sudo netplan apply