A way to connect to network through WIFI on Centos 7
Posted does
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了A way to connect to network through WIFI on Centos 7相关的知识,希望对你有一定的参考价值。
I bought a DELL laptop,but can not connect to network through wifi.There‘s lots of methods on the Internet,but few of them resolve my problem.If u face the same situation,U can try my way.
Phenomenon:
1‘ NO-CARRIER
2‘UNMANAGED
KEY Steps:
1.Get WiFi interface‘s Name
[[email protected] ~]$ nmcli device
DEVICE TYPE STATE CONNECTION
virbr0 bridge connected virbr0
virbr0-nic tap connected virbr0-nic
p1p1 ethernet unavailable --
lo loopback unmanaged --
wlp6s0 wifi unmanaged --
2.Enble WiFi Module
[[email protected] ~]$ ip link show wlp6s0
3: wlp6s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
link/ether b0:c0:90:32:c4:fa brd ff:ff:ff:ff:ff:ff
[[email protected] ~]$ su
Password:
[[email protected] does]# ip link set wlp6s0 up
[[email protected] does]# ip link show wlp6s0
3: wlp6s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000
link/ether b0:c0:90:32:c4:fa brd ff:ff:ff:ff:ff:ff
3.Scan The Wireless Net
[[email protected] does]# iw wlp6s0 scan | grep SSID
SSID: AHELLO
SSID: huohb
SSID: NULL
SSID: c2303102
SSID: xiaofeibao
Note:NULL is the name of my SSID.
[email protected]:~# wpa_passphrase NULL >> /etc/wpa_supplicant.conf 123456 [email protected]:~# (where ‘123456‘ is the Network password)
Note:There is a way to input the ssid and password in the command line,but it doesn‘t work on my PC.
4.Connect to Network
[[email protected] does]# wpa_supplicant -B -i wlp6s0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
[[email protected] does]# ip add show wlp6s0
3: wlp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether b0:c0:90:32:c4:fa brd ff:ff:ff:ff:ff:ff
inet6 fe80::b2c0:90ff:fe32:c4fa/64 scope link
valid_lft forever preferred_lft forever
5.Get IP Address
[[email protected] does]# dhclient wlp6s0
[[email protected] does]# ip add show wlp6s0
3: wlp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether b0:c0:90:32:c4:fa brd ff:ff:ff:ff:ff:ff
inet 192.168.1.105/24 brd 192.168.1.255 scope global dynamic wlp6s0
valid_lft 7202sec preferred_lft 7202sec
inet6 fe80::b2c0:90ff:fe32:c4fa/64 scope link
valid_lft forever preferred_lft forever
6.Test
[[email protected] does]# ping www.baidu.com
PING www.a.shifen.com (111.13.100.91) 56(84) bytes of data.
64 bytes from 111.13.100.91: icmp_seq=1 ttl=54 time=7.02 ms
64 bytes from 111.13.100.91: icmp_seq=2 ttl=54 time=6.10 ms
64 bytes from 111.13.100.91: icmp_seq=3 ttl=54 time=24.7 ms
64 bytes from 111.13.100.91: icmp_seq=4 ttl=54 time=5.93 ms
^C
--- www.a.shifen.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 5.938/10.964/24.794/7.995 ms
Results:
[[email protected] does]# ip link show wlp6s0
3: wlp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000
link/ether b0:c0:90:32:c4:fa brd ff:ff:ff:ff:ff:ff
[[email protected] does]# nmcli device
DEVICE TYPE STATE CONNECTION
virbr0 bridge connected virbr0
virbr0-nic tap connected virbr0-nic
wlp6s0 wifi connected wlp6s0
p1p1 ethernet unavailable --
lo loopback unmanaged
Reference:
http://www.blackmoreops.com/2014/09/18/connect-to-wifi-network-from-command-line-in-linux/
KeyWords
Connect to WiFi network from command line in Linux
以上是关于A way to connect to network through WIFI on Centos 7的主要内容,如果未能解决你的问题,请参考以下文章
3 Ways to Write Text to a File in Python
241. Different Ways to Add Parentheses
LeetcodeDifferent Ways to Add Parentheses
How to Choose the Best Way to Pass Multiple Models in ASP.NET MVC