I have a Mini PC with 2 ethernet ports and a wifi card, In this guide, we'll show how to provide internet to the second ethernet port and create a wifi access point.
graph LR
a[Router] --Ethernet 1--> b[Mini PC] --Ethernet 2--> c[Desktop PC]
b --Hotspot--> e[Phones + Laptops]
- Open Web Browser
- Type Mini PC web Address http://192.168.x.x:8006
- Select the node (pve)
- Select Networks. You should see two ethernet devices, enp1s0 and enp3s0 in this case, and 1 wireless device, wlp2s0
- Select The automatically created Linux Bridge, then Edit
- In Bridge ports:
enp1s0 enp3s0 wlp2s0 - Or you can select Shell and edit the interfaces file:
nano /etc/network/interfaces
auto lo
iface lo inet loopback
iface enp1s0 inet manual
iface enp3s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.1.110/24
gateway 192.168.1.1
bridge-ports enp1s0 enp3s0 wlp2s0
bridge-stp off
bridge-fd 0
auto wlp2s0
iface wlp2s0 inet manual
- Press Apply Configuration or type
Systemctl restart networkingin the Shell.
This should provide internet to the computer connected through the second ethernet port.
You can use the internal wifi card or a USB card. Make sure it's already bridged too.
- Select the node, then go to the Shell
lspciandlsusbto see list of connected devices, one of them should be a wireless card.apt install iwiw list, under Supported interface modes: the card should show AP. Otherwise you won't be able to create a hotspotapt install hostapdnano /etc/hostapd/hostapd.conf
interface=wlp2s0
channel=6
driver=nl80211
hw_mode=g
ssid=choose_a_hotspot_name
wpa=2
wpa_passphrase=choose_a_hotspot_password
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
auth_algs=1
country_code=US
ap_isolate=0
wpa_group_rekey=0
nano /usr/lib/systemd/system/hostapd.serviceTo make the hostapd service start after the network device in the caste of a reboot
Remove:
After=network.target
Add instead:
BindsTo=sys-subsystem-net-devices-wlp2s0.device
After=sys-subsystem-net-devices-wlp2s0.device
- To start the hostapd service:
systemctl unmask hostapd.service systemctl enable --now hostapdsystemctl restart networking