Ethernet to Wireless
The purpose of this setup is to share an Ethernet internet connection over a wireless hotspot, enabling other devices to access the internet via the Wireless hotspot created on Mecha Comet.
Prerequisites
- Ensure
nmcliandnftablesare installed on Mecha Comet. - Replace
wlan0andend0with your actual Wireless interface and outbound network interface names. - Ensure mecha comet is connected to the Ethernet network.
Steps
1
Create a Wireless Hotspot
$ sudo nmcli device wifi hotspot \
ifname <wireless-interface> \
con-name <connection-name> \
ssid <ssid-name> \
password "<password>"
Replace the placeholders:
<wireless-interface>: Your Wireless interface name (e.g., wlan0).
<connection-name>: Desired connection name (e.g., comet-hotspot).
<ssid-name>: Desired hotspot name (e.g., CometHotspot).
<password>: Desired password for the hotspot.
2
Configure IPv4 Method to Shared
$ sudo nmcli connection modify <connection-name> ipv4.method shared
3
Bring Up the Hotspot Connection
$ sudo nmcli connection up <connection-name>
4
Configure NAT with nftables
Create a NAT Table
$ sudo nft add table ip nat
Add a NAT Chain
$ sudo nft add chain ip nat POSTROUTING { type nat hook postrouting priority 100 \; }
Add a Masquerade Rule
$ sudo nft add rule ip nat POSTROUTING oif "end0" masquerade
Verification
Check the Hotspot Status
$ nmcli device status
Verify nftables Rules
$ sudo nft list table ip nat
Notes
- Replace interface names (
wlan0,end0) as needed for your setup. - This setup assumes the Mecha Comet's outbound interface is
end0. Adjust accordingly.
Troubleshooting
- If the hotspot fails to start, ensure the Wireless adapter is not connected to another network.
- Verify that
nftablesis enabled and properly configured. By following these steps, you should now have a functioning Wireless hotspot with NAT configured. 🎉
