View previous topic :: View next topic |
Author |
Message |
hasansahin n00b
Joined: 03 Jun 2010 Posts: 12
|
Posted: Thu Jan 16, 2014 7:59 am Post subject: USB Wireless device Tp-Link TL-WN822N rtl8192cu |
|
|
Hello mates,
I have a wireless usb device that is using rlt8192cu kernel module. My security profile is WEP for my wifi network.
When I have a look for my device name
Code: | ls -al /sys/class/net |
I use following commands to connect my wifi network
Code: | iwconfig wlp0218s2u2 essid <my_essid>
iwconfig wlp0218s2u2 key s:<my_WEP_key>
dhcpcd wlp0218s2u2 |
it works but sometimes dhcp service stop to working when I changed the user or chroot. and I have to apply again the above-mentioned commands.
Question 1 : iwconfig or wpa_supplicant - I could not decide which is the best? does wpa_supplicant stop to working on sometimes?
Question 2 : how can I automate the wifi-connection command as a system or boot service? or should I use networkmanager?
P.S. : I read gentoo handbook doc. and it does not explain how can I automate wifi connection (iwconfig or wpa_supplicant) as a system or boot service. Or I could not see _________________ Anyone who has never made a mistake has never tried anything new.
Albert Einstein. |
|
Back to top |
|
|
MechanicalBear n00b
Joined: 31 Jan 2014 Posts: 1
|
Posted: Fri Jan 31, 2014 3:38 am Post subject: |
|
|
If you using systemd you can create service file in /etc/systemd/system like wifi.service and place your commands with full path to binary in it.
Code: | [Unit]
Description=WIFI connectivity
[Service]
Type=simple
ExecStart=/sbin/iwconfig wlp0218s2u2 essid <my_essid>
ExecStart=/sbin/iwconfig wlp0218s2u2 key s:<my_WEP_key>
ExecStart=/sbin/dhcpcd wlp0218s2u2 |
then you must reload services
Code: | systemctl daemon-reload |
and then enable your service to run on boot
Code: | systemctl enable.wifi |
after reboot service will start wifi connectivity automatically
but the better way (if you using X) to install wicd - it is a tray application to manage both wireless and wired networks for Linux. |
|
Back to top |
|
|
|