1、设置桥接网络
2、配置固定ip
2.1、确认版本,不同版本的linux配置的位置及文件是不同的
root@ubuntu:/# lsb_release -a # 进入虚拟机 No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy
2.2、配置网络
root@ubuntu:/etc/netplan# cat 00-installer-config.yaml # 进入虚拟机 # This is the network config written by 'subiquity' network: ethernets: ens33: dhcp4: false addresses: - 172.16.200.86/24 # 将要设置的静态ip routes: - to: default via: 172.16.192.xx # gateway 和主机保持一致 nameservers: addresses: - 114.114.114.114 # 三打运营商dns - 8.8.8.8 # 谷歌dns - 101.xx.xx.198 # dns 和主机保持一致 version: 2
2.3、 重启网络
sudo netplan apply
标签:桥接,ip,虚拟机,配置,网络,dns,ubuntu22 From: https://www.cnblogs.com/bestzhang/p/17560146.html