目录

一、配置静态IP

1. 写入DHCP,配置DNS

2. 重新获取IP

二、配置动态IP


一、配置静态IP

1. 写入DHCP,配置DNS

vi /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.98
gateway 192.168.1.1
netmask 255.255.255.0
vi /etc/resolv.conf

domain
nameserver 8.8.8.8
nameserver 114.114.114.114
search localdomain

2. 重新获取IP

/etc/init.d/networking restart  

二、配置动态IP

vi /etc/network/interfaces.d

auto eth0
iface eth0 inet dhcp

重启服务

service networking restart

Logo

更多推荐