Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a a Centos PC with 2 IP addresses. One of them is because of a back to back connection with another PC, so both run on different subnets. The eth0 has the address and eth2 has on this PC.

Since is a back to back connection it doesn't have internet capability, but does. The default is set to, so whenever I do a yum update or anything it goes through, it is not able to perform the update or I am not even able to ping

Is there a way I can set the default IP address for eth2 to, e.g.,

I have already tried going to the /etc/sysconfig/network and setting the gateway to 172.x.y.z, but it didnt work .

share|improve this question

You need to setup the default must know the router address off the 172 network to do this.

Open /etc/sysconfig/network file:

 vi /etc/sysconfig/network

Setup GATEWAY={Router-IP}, if router IP is 172.x.y.z, type:


Save and close the file. Here would be the completed file:

share|improve this answer
Tried your above suggestion already, didnt work for me. Thats why came to this forum for suggestions. – vadugs Jan 8 '13 at 18:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.