装PVE时,默认把 DHCP 服务器分配的网络配置信息配成固定IP了,今天切换了网络,需要重新配置IP和DNS,故做如下笔记,其实大体上与绝大多数 Linux 都一样。

1、修改IP、网关,文件名为 /etc/network/interfaces

auto lo
iface lo inet loopback

iface ens33 inet manual

auto vmbr0
iface vmbr0 inet static
	address 192.168.100.3/24
	gateway 192.168.100.2
	bridge-ports ens33
	bridge-stp off
	bridge-fd 0

2、修改DNS服务器,文件名为 /etc/resolv.conf

search localdomain
nameserver 192.168.100.2

3、修改主机名解析的IP,文件名为 /etc/hosts

127.0.0.1 localhost.localdomain localhost
192.168.100.3 pve.localdomain pve

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

4、修改开机界面提示的URL内容,文件名为:/etc/issue ,其实改不改都不影响使用的。

------------------------------------------------------------------------------

Welcome to the Proxmox Virtual Environment. Please use your web browser to 
configure this server - connect to:

  https://192.168.100.3:8006/

------------------------------------------------------------------------------

 就是这个开机画面

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐