系统自动生成的无线网卡配置文件
CentOS75
配置文件和密码文件
nmtui和nmtui-connect可以配置出以下两个配置文件
[root@CentOS75 ~]# cat /etc/sysconfig/network-scripts/ifcfg-dlx
[root@CentOS75 ~]# cat /etc/sysconfig/network-scripts/keys-dlx
nmcli中,device和wifi要配置成enable。
另外很坑的是,笔记本上的硬件飞行模式要关掉,要不然nmcli中device一直是unavailable,且rfkill都查不到设备。
Ubuntu1804
配置文件
复制/usr/share/doc/netplan.io/examples中需要的文件(wireless.yaml)到/etc/netplan,修改成任意.yaml文件名
root@Ubuntu1804:~# ls /usr/share/doc/netplan.io/examples/
bonding_router.yaml bridge.yaml loopback_interface.yaml static_multiaddress.yaml vlan.yaml
bonding.yaml dhcp.yaml network_manager.yaml static_singlenic_multiip_multigateway.yaml windows_dhcp_server.yaml
bridge_vlan.yaml direct_connect_gateway.yaml source_routing.yaml static.yaml wireless.yaml
之后执行netplan apply使配置生效
root@Ubuntu1804:~# cat /etc/netplan/eth0.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 66.66.66.2/24
root@Ubuntu1804:~# netplan apply
root@Ubuntu1804:~# ip a l eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether c8:cb:b8:02:a9:cb brd ff:ff:ff:ff:ff:ff
inet 66.66.66.2/24 brd 66.66.66.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::cacb:b8ff:fe02:a9cb/64 scope link
valid_lft forever preferred_lft forever
推荐在Ubuntu中也使用NetworkManager,体验比netplan好很多..