1

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.

William
  • 213
  • 6
  • 15

2 Answers2

1

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?

Garrett
  • 1,638
  • 4
  • 15
  • 25
1

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.

L.R.
  • 775
  • 6
  • 11