# routing DNS requests using multiple nics



## jhamlin96 (Jun 2, 2010)

Hi all,

Im new to the wide world of FreeBSD, and was wondering how you could have lets say 2 or 3 nics installed in a server, and have all 3 connected to same router, but have 1 listen and serve up webpages, email etc. but have one bound to TCP requests for DNS, and have one bound for UDP for DNS, to minimize packet collison/errors. I am fairly new to FreeBSD, but have worked with Windows servers for a while. Any advice/comments/configuration info and tutorial site are appreciated.


----------



## SirDice (Jun 2, 2010)

Packet collisions/errors are going to happen anyway. All three interfaces would be on the same subnet (aka broadcast domain). It's not going to work that way (even on Windows it won't).

If you're looking for a fail-over/load-balancing solution have a look at lagg and CARP.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-aggregation.html
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/carp.html


----------



## PhenomII (Jun 8, 2010)

Greetings,
 As far as "packet collisions" go, PF(4) might be of some help here. You could also leverage it to route requests by protocol, as well as IP address.

HTH

Best wishes.


----------



## ohauer (Jun 8, 2010)

Don't worry about collisions until you have scrappy hardware.
But if you want to separate traffic across IP addresses use ifconfig(8)() aliases.
Keep in mind interface aliases have always a 255.255.255.255. netmask where windows want the same mask as the main IP and not all deamons support bind to IP X (ntpd for example)


----------



## DutchDaemon (Jun 8, 2010)

ohauer said:
			
		

> Keep in mind interface aliases have always a 255.255.255.255.



_Only_ if those aliases are in the _same_ network as the primary IP address. You can alias a separate (non-related) IP/network with its own netmask on an interface.


----------

