1. 查看网络
命令:
ifconfig
结果
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 22051 bytes 1805737 (1.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 22051 bytes 1805737 (1.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::2c0:73b1:103a:35f7 prefixlen 64 scopeid 0x20<link>
ether d4:12:43:c3:6e:26 txqueuelen 1000 (Ethernet)
RX packets 8042 bytes 770912 (770.9 KB)
RX errors 0 dropped 8 overruns 0 frame 0
TX packets 9241 bytes 397698 (397.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2. 建立和删除一个wifi连接
查看wifi列表:
nmcli dev wifi list
创建wifi连接(SSID:wifi名称,密码:12345678,默认使用设备wlan0)的示例:
nmcli device wifi connect wifi名称 password 12345678
执行命令后,会在 /etc/NetworkManager/system-connections/ 目录下创建一个新文件来保存网络配置
删除wifi连接的示例:
nmcli con del wifi名称
3. 配置网络
命令:
sudo ifconfig ens33 192.168.1.130 netmask 255.255.255.0
设置网关:
sudo route add default gw 192.168.1.0
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)