ubuntu配置IP地址

服务器   发布日期:2小时前   浏览次数:75

使用ubuntu 16.04 server版本
ubuntu server版本只用这个文件作为网卡配置。
1、编辑网卡文件
sudo vim /etc/network/interfaces

2、添加参数
动态:
auto eth0
iface eth0 inet dhcp
静态:
auto eth0
iface eth0 inet static
address 192.168.199.61
netmask 255.255.255.0
gateway 192.168.199.1
dns-nameservers 114.114.114.114
#pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
#从udev中查看

3、服务重启
sudo /etc/init.d/networking restart

4、ping dns测试
ping 114.114.114.114

以上就是ubuntu配置IP地址的详细内容,更多关于ubuntu配置IP地址的资料请关注九品源码其它相关文章!