ESxi 安装debian 网络设置

1、设置IP地址、网关

nano /etc/network/interfaces /etc/network/interfacesbak #备份原配置文件
nano /etc/network/interfaces #编辑网卡配置文件

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo                                   #开机自动连接网络
iface lo inet loopback
# The primary network interface
allow-hotplug ens192
iface ens192 inet static  #static表示使用固定ip,dhcp表述使用动态ip
address 10.10.10.162  #设置ip地址
netmask 255.255.255.0  #设置子网掩码
gateway 10.10.10.253  #设置网关

ctrl+o #保存配置
ctrl+x #退出

2、设置dns

cp /etc/resolv.conf /etc/resolv.confbak #备份原dns配置文件
nano /etc/resolv.conf #编辑配置文件
nameserver  223.5.5.5
nameserver 223.6.6.6
ctrl+o #保存配置
ctrl+x #退出

3、重启网络

service networking restart