---
title: "network config on centos"
author: "mathgl"
date: "2014-04-03T09:50:53Z"
tags: []
categories: ["非技术"]
slug: "network-config-on-centos"
draft: false
lastmod: "2014-04-03T09:50:53Z"
id: 2040337
url: "https://mathgl.iteye.com/blog/2040337"
---

edit /etc/sysconfig/network-scripts/ifcfg-eth0 (first network card, ifcfg-eth1 is the second)

 

DEVICE=eth0

BOOTPROTO=static

IPADDR=192.168.3.110

NETMASK=255.255.255.0

ONBOOT=yes

DHCPCLASS=

 

edit /etc/sysconfig/network

 

NETWORKING=yes

HOSTNAME=xxx

GATEWAY=192.168.3.1

 

edit /etc/resolv.conf

 

nameserver 8.8.8.8

 

/etc/init.d/network restart