ubuntu 20.04 设置静态 IP地址
ifconfig
参考:
Ubuntu20.04修改ip地址的方法示例
https://www.jb51.net/article/187742.htm
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.99.45 netmask 255.255.255.0 broadcast 192.168.99.255
inet6 fe80::20c:29ff:feee:a4f2 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:a4:f2 txqueuelen 1000 (Ethernet)
RX packets 262489 bytes 389159294 (389.1 MB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 94544 bytes 7738507 (7.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1000 (Local Loopback)
RX packets 288 bytes 25608 (25.6 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 288 bytes 25608 (25.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
cd /etc/netplan
sudo vi 01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
addresses: [192.168.99.45/24]
dhcp4: no
optional: true
gateway4: 192.168.99.1
nameservers:
addresses: [192.168.99.1,8.8.8.8]
sudo netplan apply
本文详细介绍了如何在Ubuntu20.04操作系统中为ens33网卡配置静态IP地址,包括修改netplan配置文件并应用更改的步骤。通过设置静态IP,你可以确保网络连接的稳定性。
4万+

被折叠的 条评论
为什么被折叠?



