ubuntu配置IP地址


使用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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM