AP nmcli

Aus xinux.net
Zur Navigation springen Zur Suche springen

Installation

Wir brauchen einen NetworkManager und eine Light Version von Name und DHCP Server
  • apt update
  • apt install dnsmasq

Host AP aktivieren

  • nmcli dev wifi hotspot ifname wlan0 ssid test password "test1234"

Host IP Adresse setzen

  • nmcli connection modify Hotspot ipv4.method manual ipv4.addresses 192.168.178.1/24

Wie heist der AP?

  • nmcli connection show
NAME                UUID                                  TYPE      DEVICE 
Wired connection 1  04ce7d80-e44b-4a8d-9305-b2ad8c72a590  ethernet  eth0   
Hotspot             64b34b3b-46af-44ba-80b3-e4f5119d85ee  wifi      wlan0*

Aktivieren

  • nmcli connection down Hotspot ; nmcli connection up Hotspot
Connection 'Hotspot' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)

Netzwerkarbeiten[Bearbeiten]

Alles aus diesem LAN wird maskiert

  • iptables -t nat -A POSTROUTING -s 192.168.178.0/24 -j MASQUERADE

Forwarding einschalten

  • sysctl -w net.ipv4.ip_forward=1

Installation dnsmasq