On Sun, 2016-03-27 at 11:22 +0200, Thomas Haller wrote: > On Sat, 2016-03-26 at 17:53 +0100, devops036 devops036 wrote: > > > > Hi, > > > > I recently installed a home server under CentOS 7. > > I wanted to use it as a Wifi Hotspot. > > I tried to activate this feature at the command line without > > success. > > I couldn't find a command, a script, any documentation locally or > > on > > the Internet to do that! > > > > The only solution was to install a graphical desktop that I didn't > > need, execute the nm-connection-editor command and press the Wifi > > Hotspot button. > > > > Is it normal? > > There are multiple client applications that all communicate via D-Bus > with NetworkManager. > > > On nm-1.2 there will be a command `nmcli device wifi hotspot` to > create > a wifi hotspot. However, there is no direct alternative on nm- > 1.0/rhel- > 7.2. > > Note that `nmcli device wifi hotspot` is just a convenience command. > You can achieve the same outcome by modifying an existing connection > to > have all to settings for a wifi-hotspot. Something like > > nmcli connection modify $CONNECTION \ > 802-11-wireless.mode ap \ > ipv4.method shared \ > #more settings... > > or try: > > nmcli connection edit $CONNECTION > > > The problem is of course, *what* are the correct settings. See `man > nm- > settings` or type help/describe in edit mode. > > > > Note that all clients in the end create a text file with the > connection > settings. Either in /etc/NetworkManager/system-connections or (on > CentOS) /etc/sysconfig/network-scripts/ifcfg-*. > You can edit the files directly. The manual pages are again nm- > settings, nm-settings-ifcfg-rh and nm-settings-keyfile. > > > Or, say you used nm-connection-editor on another host, look at the > fields that it set: `nmcli connection show $CONNECTION` > > > > > > Then, I tried to read the sources of the NetworkManager packages to > > find out what was done behind the Wifi Hotspot button. > Which Wifi Hotspot button do you mean?
Probably the GNOME Shell / gnome-control-center one... but that's really all it does. It looks for a specific connection name that it previously created and activates that, otherwise it creates a new connection with the right properties and starts that instead. https://git.gnome.org/browse/gnome-control-center/tree/panels/network/net-device-wifi.c#n1004 Dan > The nm-connection-editor sources are in the "network-manager-applet" > package. > > > > > > I didn't succeed. > nmcli (on nm-1-2, not rhel-7.2) does: > https://cgit.freedesktop.org/cgit/?url=NetworkManager/NetworkManager/ > tree/clients/cli/devices.c&id=bbc941245dac37083f0b46e115191c59bfbf95e > b#n3073 > > > nm-connection-editor it's not in one place because there are just a > bunch of UI input fields that interact: > https://git.gnome.org/browse/network-manager-applet/tree/src/connecti > on-editor?id=027ca27169bb9425594b3c82d927c1ff861537e9 > basically, page-wifi.c, page-wifi-security.c and page-ip4.c work > together when you select the "Hotspot" mode. > > > > > > > Although I perfectly understand that documentation is something > > difficult to put in place, in this case there is almost nothing. > > > > Would anybody be nice to point me to a documentation that I > > wouldn't > > have found or write some procedure to configure Wifi hotspot from > > the > > command line with some explanations about the steps? > > Thomas > _______________________________________________ > networkmanager-list mailing list > [email protected] > https://mail.gnome.org/mailman/listinfo/networkmanager-list _______________________________________________ networkmanager-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/networkmanager-list
