Linux网络设置

==========================网络设置==========================

1、IP地址
临时:ifconfig 192.168.124.129
永久: vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.124.129
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet

service network restart

2、网关

win->route print
linux->route -n
临时:route add default gw 192.168.124.1
永久: vi /etc/resolv.conf

GATEWAY=192.168.124.1
vi /etc/sysconfig/network-scripts/ifcfg-eth0

GATEWAY=192.168.124.1

3、DNS服务器

1)自己解析
vi /etc/hosts

2)dns域名服务器解析

vi /etc/resolv.conf

nameserver 192.168.124.2

4、主机名
临时配置:hostname server

永久配置: vi /etc/sysconfig/network
HOSTNAME=SERVER

posted @ 2014-02-25 20:43  jamesbd  阅读(238)  评论(0编辑  收藏  举报