[Linux]Ubuntu配置修改网络连接配置
Ubuntu的网络配置与CentOS相比区别不大,具体方法如下:
1.使用编辑器打开网卡的配置文件,这里默认使用eth0
vi /etc/network/interfaces |
键入以下内容
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 #自动配置eth0 iface eth0 inet static #设置为静态配置,需要动态获取ip时可选dhcp address 192.168.0.100 #IP地址 broadcast 192.168.0.255 #对应的子网广播地址 netmask 255.255.255.0 #子网掩码 network 192.168.0.0 #网络地址 gateway 192.168.0.1 #网关地址,可选设定 |
2.修改DNS解析,编辑resolv.conf文件
vi /etc/resolv.conf |
键入
nameserver 8.8.8.8 nameserver 8.8.4.4 |
修改完resolv.conf后dns解析会立即生效
3.重启网络配置
/etc/init.d/networking restart |
Properly just considered i’d say howdy. Terrific web site Ian.
Its great to be here!Wish you all a pleased time.
Good to determine all people posting! Great luck to all, except against me!
all dear,meet the following with exact same interest.