ubuntu ip设置

来源:互联网 发布:诺基亚5233下载软件 编辑:程序博客网 时间:2024/06/09 23:27


1.编辑/etc/network/interfaces

xiecg@ubuntu:~$ sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0

iface eth0 inet dhcp

注意最后一行,默认为iface eth0 inet manual,修改为iface eth0 inet dhcp

2.重启网络服务

xiecg@ubuntu:~$ sudo /etc/init.d/networking restart

参考:http://blog.sina.com.cn/s/blog_71261a2d0100uddl.html


2.固定ip 配置如下 注意dns设置

# The loopback network interface
auto lo
iface lo inet loopback



# Internal Network
auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1


# External Network
auto eth1
iface eth1 inet static
address 10.0.0.20
netmask 255.255.255.0


0 0
原创粉丝点击