Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup a private network but I want one of the machines to connect to both this private network and another outside network via two NICs. I would like eth0 to be used for every IP address except for 10.0.0.1, which I would like to be accessed through eth1. There is a DHCP and DNS server on this private network but I can't seem to get both the names on the private network and the names on the outside network to resolve. Is there a way I can make this work with the route command?

Thanks, any help is appreciated.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I would like eth0 to be used for every IP address except for 10.0.0.1, which I would like to be accessed through eth1.

Set your routing table to:

  1. route all packets for the 10.0.0.1 via eth1.

    route add -host 10.0.0.1 dev eth1

  2. default route via eth0 (this is probably already done)

    route add -default dev eth0

  3. check the result with route -n (-n disables hostname lookup)

If it works, store your settings permanently - CentOS has some documentation here

For the DNS, you will need to check /etc/resolv.conf to see if all DNS are listed.

share|improve this answer

Connect both networks, but set a high metric on the interface with only 1 address. Metric is like a "cost of use" so your computer will use the lower metric interface for everything it can.

Can you post your route entries?

share|improve this answer

Your Answer

 
discard

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.