---
title: "RedHat 6 下配置网卡IP地址，Virtual Linux下配置网卡IP"
author: "xianbin"
date: "2015-01-29T11:46:01Z"
tags: ["CentOS", "Linux", "RedHat"]
categories: ["操作系统"]
slug: "redhat-6-ip-virtual-linux-ip"
draft: false
lastmod: "2015-01-29T11:46:01Z"
id: 2181190
url: "https://xianbin.iteye.com/blog/2181190"
---

经常用到，自己Mark一下，顺带给需要的人参考。

1、配置文件修改
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0

内容：

```java

DEVICE="eth0"
HWADDR="08:00:27:7C:D1:95"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR="192.168.56.5"
GATEWAY="192.168.56.1"
BOOTPROTO="STATIC"

```


2、立即生效配置
$ sudo /etc/init.d/network stop
$ sudo /etc/init.d/network start