NetworkMgr for GhostBSD 11.1 proper setup to use?  [SOLVED]

Help with setting up network cards, including WiFi cards.
Post Reply
wb7odyfred
Posts: 22
Joined: Sat Nov 12, 2016 5:44 pm
Has thanked: 0
Been thanked: 0

NetworkMgr for GhostBSD 11.1 proper setup to use?

Post by wb7odyfred » Mon Dec 18, 2017 12:30 pm

I am typing this from GhostBSD 11.1 Live Session booting from a USB Flash Drive (use Legacy BIOS entry NOT the UEFI BIOS enty) selecting a USB Flash Drive.

My HowTo connect an Atheros PCI AR9565 to a T-Mobile Hot Spot from the cell phone with WPA encryption.
This is my manual setup issuing commands. I don't know how GhostBSD in the Live Session has NetworkMgr setup to help with a Wi-Fi access point connection. Maybe NetworkMgr is doing some heavy lifting in the background that I have not a clue about. I don't see the normal NetworkMgr Icon in Blue in the upper right hand control panel. So Eric and other GhostBSD 11.1 Live Session users help us out with testing and comments.

Open a ROOT Terminal MENU --> Applications --> Accessories --> Root Terminal
Edit file /etc/wpa_supplicant.conf using your favorite text editor ee, nano, or vi
vi /etc/wpa_supplicant.conf

Code: Select all

network={
  	ssid="ES_32439"
  	psk="42600000"
}
root@ghostbsd:~ # cat /etc/wpa_supplicant.conf
network={
ssid="ES_32439"
psk="42600000"
}

Code: Select all

ifconfig wlan0 up scan
ifconfig wlan0 down
ifconfig wlan0 channel 8 ssid ES_32439
ifconfig wlan0 up
wpa_supplicant  -d -K -iwlan0 -c/etc/wpa_supplicant.conf
When the networking is finally working use this wpa_supplicant command to put the dameon in the background

Code: Select all

wpa_supplicant  -s -B -iwlan0 -c/etc/wpa_supplicant.conf
open a second Root Terminal
issue a ping command to check connectivity

Code: Select all

ping -c 3 8.8.4.4
ping -c 3 he.net 
ping -c 3 ghostbsd.org
See the IP4 routes printed out and the IP4 Sockets being used

Code: Select all

netstat -4r
sockstat -4
Networking Not working, then issue a dhclient command

Code: Select all

dhclient wlan0
or if dhclient is already running, then kill the dhclient process and restart dhclient

Code: Select all

killall dhclient
dhclient wlan0
root@ghostbsd:~ # ifconfig wlan0 up scan
SSID/MESH ID BSSID CHAN RATE S:N INT CAPS
ES_32439 5c:af:06:4f:bc:83 8 54M -83:-96 100 EPS WPA HTCAP WME
root@ghostbsd:~ # ifconfig wlan0 down
root@ghostbsd:~ # ifconfig wlan0 channel 8 ssid ES_32439
root@ghostbsd:~ # ifconfig wlan0 up
root@ghostbsd:~ # ifconfig wlan0
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether ec:0e:c4:1f:ea:73
hwaddr ec:0e:c4:1f:ea:73
inet 192.168.43.114 netmask 0xffffff00 broadcast 192.168.43.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid ES_32439 channel 8 (2447 MHz 11g)
regdomain 108 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7
scanvalid 60 protmode CTS wme burst
groups: wlan
root@ghostbsd:~ #
or use a "Service netif restart" command

Code: Select all

service netif restart
service routing restart
root@ghostbsd:/home/ghostbsd # service netif restart
wpa_supplicant not running? (check /var/run/wpa_supplicant/wlan0.pid).
dhclient not running? (check /var/run/dhclient.wlan0.pid).
Stopping Network: lo0 wlan0.
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
wlan0: flags=8c02<BROADCAST,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether ec:0e:c4:1f:ea:73
hwaddr ec:0e:c4:1f:ea:73
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid ES_32439 channel 8 (2447 MHz 11g ht/20)
regdomain 108 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7
scanvalid 60 protmode CTS ampdulimit 8k ampdudensity 8 shortgi
-stbctx stbcrx wme burst
groups: wlan
Destroyed wlan(4) interfaces: wlan0.
Created wlan(4) interfaces: wlan0.
wpa_supplicant already running? (pid=2368).
Starting Network: lo0 wlan0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether ec:0e:c4:1f:ea:73
hwaddr ec:0e:c4:1f:ea:73
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid "" channel 5 (2432 MHz 11g)
regdomain 108 indoor ecm authmode WPA1+WPA2/802.11i privacy MIXED
deftxkey UNDEF txpower 20 bmiss 7 scanvalid 60 protmode CTS wme burst
roaming MANUAL bintval 0
groups: wlan
root@ghostbsd:/home/ghostbsd # ps ax | grep wlan
2368 - Ss 0:00.01 /usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_sup
2452 - Ss 0:00.00 dhclient: wlan0 [priv] (dhclient)
2510 - Ss 0:00.00 dhclient: wlan0 (dhclient)
2513 5 S+ 0:00.01 grep wlan
root@ghostbsd:/home/ghostbsd #
Other checks to perform

Code: Select all

ps ax | grep wlan
root@ghostbsd:/home/ghostbsd # ps ax | grep wlan
1696 - Is 0:00.01 dhclient: wlan0 [priv] (dhclient)
1754 - Is 0:00.00 dhclient: wlan0 (dhclient)
1686 2 S+ 0:00.14 wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf
1988 5 S+ 0:00.00 grep wlan

Code: Select all

ps ax | grep net
root@ghostbsd:/home/ghostbsd # ps ax | grep net
931 - I 0:00.37 /usr/local/bin/python2.7 /usr/local/bin/networkmgr
1860 - S 0:09.43 /usr/local/bin/hexchat --url=irc://irc.freenode.net:666
1990 5 S+ 0:00.00 grep net
Searching for NetworkMgr setup
Github where you can clone it and install the Python 3.6 and GTK3 version
https://github.com/GhostBSD/networkmgr
EricBSD call for testers
viewtopic.php?f=98&t=943&p=5318&hilit=networkmgr#p5318
Phishfry setup for an earlier version
https://forums.freebsd.org/threads/61746/

My question does networkmgr work out of the box in the Live Session GhostBSD 11.1 booting from a USB Flash Drive? What setup was I missing? How do you do it for a Live Session GhostBSD? I showed you my manual setup above that seems to work ok.
I assume if I install GhostBSD 11.1 to some hard drive and then update per the github clone description that I will have an operational NetworkMgr with icons and wireless scan information. Is this true?

User avatar
ericbsd
Developer
Posts: 1177
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 3 times
Been thanked: 4 times

Re: NetworkMgr for GhostBSD 11.1 proper setup to use?

Post by ericbsd » Tue Dec 19, 2017 2:27 pm

NetworkMgr should work out of the box if the kernel module is loaded. But to be noted that NetworkMgr 2.5 only supports one wired card and one wifi card witch next NetworkMgr will support multiple cards setup and in the tray icon menu.

It is possible that the card might not be set up by NetworkMgr.

tankist02
Posts: 15
Joined: Wed Sep 04, 2013 5:46 pm
Has thanked: 0
Been thanked: 0

Re: NetworkMgr for GhostBSD 11.1 proper setup to use?

Post by tankist02 » Tue Dec 26, 2017 6:08 pm

Which kernel module should be loaded? Is there a definitive and up-to-date documentation for NetworkMgr anywhere? I'm trying to set it up on FreeBSD 11-STABLE, but I don't see any man pages.

User avatar
ericbsd
Developer
Posts: 1177
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 3 times
Been thanked: 4 times

Re: NetworkMgr for GhostBSD 11.1 proper setup to use?

Post by ericbsd » Fri Dec 29, 2017 1:51 pm


User avatar
ericbsd
Developer
Posts: 1177
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 3 times
Been thanked: 4 times

Re: NetworkMgr for GhostBSD 11.1 proper setup to use?

Post by ericbsd » Fri Dec 29, 2017 1:53 pm

There is now kernel module to load unless you need one for your network card.

wb7odyfred
Posts: 22
Joined: Sat Nov 12, 2016 5:44 pm
Has thanked: 0
Been thanked: 0

Re: NetworkMgr for GhostBSD 11.1 NO ICON Displayed in Tray

Post by wb7odyfred » Mon Jan 08, 2018 5:09 am

NetworkMgr for GhostBSD 11.1 NO ICON Displayed in Tray

Here are some details from killing the NetworkMgr process and restarting it.

root@fred:/etc # ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether ec:0e:c4:1f:ea:73
hwaddr ec:0e:c4:1f:ea:73
inet 10.59.27.30 netmask 0xffffe000 broadcast 10.59.31.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
status: associated
ssid innflux channel 6 (2437 MHz 11g ht/20) bssid 2c:e6:cc:25:68:78
regdomain 108 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7
scanvalid 60 protmode CTS ampdulimit 64k shortgi -stbctx stbcrx wme
burst
groups: wlan
root@fred:/etc # ps ax | grep net
1098 - I 0:00.30 /usr/local/bin/python2.7 /usr/local/bin/networkmgr
4063 1 S+ 0:00.01 grep net
root@fred:/etc # kill 1098
root@fred:/etc # /usr/local/bin/networkmgr
Your wifi network card is already configured.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/share/networkmgr/trayicon.py", line 305, in checkloop
self.nmMenu = self.nm_menu()
File "/usr/local/share/networkmgr/trayicon.py", line 88, in nm_menu
if wiredonlineinfo() is True:
File "/usr/local/share/networkmgr/net_api.py", line 88, in wiredonlineinfo
lan = Popen('doas ifconfig ' + wirecard(), shell=True,
File "/usr/local/share/networkmgr/net_api.py", line 83, in wirecard
card = wireNics.stdout.readlines()[0].partition('=')[0].partition('_')[2]
IndexError: list index out of range


I am looking for some tests or diagnostics to get the networkmgr working properly to display an ICON.
Here is http://www.linuxsecrets.com website showing GhostBSD 11.1 Installation. His pictures / images show the Blue Icon for Networkmgr in the icon tray. What is missing in the setup and installation of GhostBSD 11.1 from the 2017 image.
https://www.linuxsecrets.com/3190-install-ghostbsd See the Blue Arrows ICON in the image below? I don't have that on my Ghost BSD 11.1 system. Look above and you will see the /usr/local/bin/networkmgr process running. I killed it and restarted it to see if I could list the errors. Which you have above. I am running an Atheros PCI Wifi chip AR9565.
I can manually make the wifi connection using the tools ifconfig, dhclient. and editing the file /etc/wpa_supplicant.conf .
Image

What I am trying to show is a problem with Wifi connection using the GhostBSD 11.1 live session and the GhostBSD 11.1 installed to an external USB Hard Drive. Hopefully, this is a small error or change need to make to a configuration file. Ask me for more information to help me identify the problem with getting the NetworkMgr Icon up. Otherwise, using the manual method works. I can also now install / upgrade NetworkMgr from your GitHub site, which should make it work. What do you suggest to try Eric. I would like to fix this error and document here, So that other GhostBSD users can be helped.

{Solved] when looking at the source card file /usr/local/bin/netcardmgr.py I see tha t it checks for Ethernet LAN card devices, but my Dell Inspiron 11 3000 series does not have ANY LAN device in the notebook motherboard. See the results below of running these two commands.
root@fred:~ # ifconfig -l
lo0 wlan0
root@fred:~ # sysctl -in net.wlan.devices
ath0
root@fred:~ #

wb7odyfred
Posts: 22
Joined: Sat Nov 12, 2016 5:44 pm
Has thanked: 0
Been thanked: 0

Re: NetworkMgr for GhostBSD 11.1 proper setup to use?

Post by wb7odyfred » Thu Jan 11, 2018 12:10 pm

In the file /usr/local/share/networkmgr/net_api.py there is a test for the LAN card
around line 79 is a test for a LAN card using the wirecard(): function
I modified this to suit my needs for my Laptop that does not have a LAN ethernet device.
This python program /usr/local/bin/networkmgr kept crashing on me. I never did see any Blue Tray Icon. So I made the following modifications to get past this wired LAN device check to configure my WiFi Atheros QCA9565 PCI device. Now I see the Blue NetworkMgr Tray Icon and can click on it to make changes and see what WiFi access points exist

from file /usr/local/share/networkmgr/net_api.py line #79
# need a better way to find card active card.
def wirecard():
wireNics = Popen('cat /etc/rc.conf | grep ifconfig_ | grep -v wlan',
shell=True, stdout=PIPE, close_fds=True)
# check if NO LAN device exists, ie wireNics is an empty string
if wireNics:
#for line in wireNics.stdout:
print("wireNics String -->")
print(wireNics)
print("<--")
#card = wireNics.stdout.readlines()[0].partition('=')[0].partition('_')[2]
#return card
return "wlan0"
else:
print("WireNics String is empty")
return "wlan0"

:shock:
root@fred:/usr/home/fred # cat /etc/rc.conf | grep ifconfig_ | grep wlan
ifconfig_wlan0="WPA SYNCDHCP"
root@fred:/usr/home/fred # cat /etc/rc.conf | grep ifconfig_ | grep -v wlan > grep_temp.txt
root@fred:/usr/home/fred
root@fred:/usr/home/fred # ls -la g*
-rw------- 1 fred wheel 15765504 Jan 9 06:15 gksu.core
-rw-r--r-- 1 root wheel 0 Jan 11 06:36 grep_temp.txt

See the file size of "grep_temp.txt" is zero, an empty string.
The "grep -v wlan" prints lines that DONT MATCH "wlan" which should leave lines of text with the LAN device. Since there is no existing LAN device on my laptop, this grep search returns an empty string of zero characters. This a problem for the existing networkmgr code on my laptop.
:mrgreen:
I will now download and try out the newer version of networkmgr from Github GhostBSD and see if the multicard feature deals correctly with the NO ethernet LAN Device, but one WiFi LAN device, correctly.

wb7odyfred
Posts: 22
Joined: Sat Nov 12, 2016 5:44 pm
Has thanked: 0
Been thanked: 0

Re: NetworkMgr version 1.10 for GhostBSD 11.1  [SOLVED]

Post by wb7odyfred » Thu Jan 11, 2018 1:13 pm

Yahoo, it is ALIVE. NetworkMgr version 1.10 is working for me on my Dell Inspiron 11 3000 series laptop.
https://github.com/GhostBSD/networkmgr#networkmgr
Follow the instructions at the above listed GitHub Website. Completed this NetworkMgr install in about 5 minutes.
Wonderful tool to use.

root@fred:/usr/home/fred/networkmgr # cat /usr/local/etc/doas.conf

Code: Select all

permit nopass keepenv root
permit :wheel
permit nopass keepenv :wheel cmd netcardmgr
permit nopass keepenv :wheel cmd detect-nics
permit nopass keepenv :wheel cmd detect-wifi
permit nopass keepenv :wheel cmd ifconfig
permit nopass keepenv :wheel cmd service
permit nopass keepenv :wheel cmd wpa_supplicant
permit nopass keepenv :wheel cmd fbsdupdatecheck
permit nopass keepenv :wheel cmd fbsdpkgupdate
permit nopass keepenv :wheel cmd pkg args upgrade -y
permit nopass keepenv :wheel cmd pkg args upgrade -Fy
permit nopass keepenv :wheel cmd pkg args lock
permit nopass keepenv :wheel cmd pkg args unlock
permit nopass keepenv :wheel cmd mkdir args -p /var/db/update-station/
permit nopass keepenv :wheel cmd chmod args -R 665 /var/db/update-station/
permit nopass keepenv :wheel cmd sh args /usr/local/lib/update-station/cleandesktop.sh
permit nopass keepenv :wheel cmd shutdown args -r now
root@fred:/usr/home/fred/networkmgr #

add user fred to group wheel

root@fred:/usr/home/fred # pw groupshow wheel
wheel:*:0:root
root@fred:/usr/home/fred #

Code: Select all

pw groupmod wheel -m fred 
root@fred:/usr/home/fred #

Code: Select all

pw groupshow wheel
wheel:*:0:root,fred
root@fred:/usr/home/fred
Now execute networkmgr to see any error messages print out in the terminal window.

Best of Luck, and thanks for this tool Eric. ps. you might want to add an "about" function to show version number.

User avatar
ericbsd
Developer
Posts: 1177
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 3 times
Been thanked: 4 times

Re: NetworkMgr version 1.10 for GhostBSD 11.1

Post by ericbsd » Tue Jan 16, 2018 1:57 pm

wb7odyfred wrote: Best of Luck, and thanks for this tool Eric. ps. you might want to add an "about" function to show version number.
That is a great idea.

Post Reply