码迷,mamicode.com
首页 > 系统相关 > 详细

linux网络相关配置

时间:2015-06-20 14:25:10      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:linux

ip地址配置文件 vi /etc/sysconfig/network-scripts/ifcfg-eth0

内容

DEVICE="eth0"

BOOTPROTO="static"

HWADDR="00:0C:29:96:08:F0"

IPADDR=192.168.1.151

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

NM_CONTROLLED="yes"

ONBOOT="yes"

TYPE="Ethernet"

UUID="b2479135-8f5d-4633-b898-6155c4ef2650"

重启服务器 /etc/init.d/network restart



dns配置文件 vi /etc/resolv.conf


# Generated by NetworkManager



# No nameservers found; try putting DNS servers into your

# ifcfg files in /etc/sysconfig/network-scripts like so:

#

# DNS1=xxx.xxx.xxx.xxx

# DNS2=xxx.xxx.xxx.xxx

# DOMAIN=lab.foo.com bar.foo.com

nameserver 8.8.8.8


直接生效



本文出自 “01” 博客,请务必保留此出处http://yuzifei.blog.51cto.com/10436433/1663809

linux网络相关配置

标签:linux

原文地址:http://yuzifei.blog.51cto.com/10436433/1663809

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!