linux设置ip地址
2012-07-31 20:26
127 查看
手动临时设置IP
sudo ifconfig eth0 up 192.168.1.10
手动设置IP一般在系统重启后就失效
静态设置IP
Ubuntu网络配置信息保存在 /etc/network/interfaces 文件中,默认内容如下:
auto eth0
iface eth0 inet dhcp
auto lo
iface lo inet loopback
设置静态ip的方法如下:
使用root用户编辑 /etc/network/interfaces
i)注释掉第二行,设置静态ip有关参数
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto lo
iface lo inet loopback
ii)编辑 /etc/resolv.conf,设置dns
nameserver 202.96.134.86
nameserver 202.106.0.166
iii)关闭后重启,使新设置生效
$sudo ifconfig eth0 down
$sudo ifconfig eth0 up
sudo ifconfig eth0 up 192.168.1.10
手动设置IP一般在系统重启后就失效
静态设置IP
Ubuntu网络配置信息保存在 /etc/network/interfaces 文件中,默认内容如下:
auto eth0
iface eth0 inet dhcp
auto lo
iface lo inet loopback
设置静态ip的方法如下:
使用root用户编辑 /etc/network/interfaces
i)注释掉第二行,设置静态ip有关参数
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto lo
iface lo inet loopback
ii)编辑 /etc/resolv.conf,设置dns
nameserver 202.96.134.86
nameserver 202.106.0.166
iii)关闭后重启,使新设置生效
$sudo ifconfig eth0 down
$sudo ifconfig eth0 up
相关文章推荐
- linux IP地址 网关设置
- Linux_Centos如何设置IP地址,LINUX怎么修改IP地址
- Linux - 设置Ubuntu的IP地址
- Centos如何设置IP地址,LINUX怎么修改IP地址
- Linux系统下如何设置IP地址?
- linux环境一个服务器设置多个Ip地址
- Linux下一块网卡设置多个IP地址
- CentOS/Linux下设置IP地址
- linux IP地址网关设置和双网卡设置
- CentOS/Linux 网卡设置 IP地址配置
- Centos如何设置IP地址,LINUX怎么修改IP地址
- Linux 设置IP地址
- Linux 网卡设置 IP地址配置 网络配置
- linux IP地址设置大全(各系统全)
- 如何在linux系统中设置ip地址
- linux防火墙iptables常用规则(屏蔽IP地址、禁用ping、协议设置、NAT与转发、负载平衡、自定义链)
- Linux tomcat设置ip地址直接访问,tomcat设置ip地址直接访问,tomcat绑定ip地址
- SUSE Linux Enterprise Server 设置IP地址、网关、DNS的方法
- linux系统更改网卡信息,将IP地址设置为固定IP
- 设置Linux系统的固定IP地址