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 need to configure default gateways for four separate physical network interfaces for a FreeBSD Webserver. Basically, this is a web server that needs to be accessed by multiple WANS. I've been using various online resources, and a combination of setfib, pf, and ipfw. This web server will be deployed in multiple sites where access to next hop router info is not available, so we can't use static routes.

We've used setfib to successfully create multiple routing tables and can ping beyond every default gateway we've created. Using setfib # ping ip.addr.what.ever we can ping anything available on a wan and beyond the router. The problem is we can't get Apache web server (port 80) traffic to route out when external users access the server(box).

Multiple people have examples of binding setfib to ipfw commands, but none of them seem to work.

share|improve this question
I suspect you will need to provide more information to this question about what you have tried so far in setting up your route tables, address translation, firewall rules. The type of setup your describe is pretty uncommon. You mention clients are accessing port 80, but are they using a unique address per interface as well? – Zoredache Dec 20 '10 at 22:03
Yes, they would need to be able to access port 80 traffic on all address ranges per gateway (per physical port). sounds bad, but I know someone has been able to do this with iptables in a Linux environment. My application requires freeBSD, so I'm stucking looking for such a solution. Thanks guys! – user20010 Dec 21 '10 at 22:08

Quite old thread, replying in case it's still helpful for someone. I remember doing something similar with pf's route-to and reply-to directives to get the similar effect.

share|improve this answer

Using a routing advertisement protocol like RIP, OSPF, BGP, etc to configure the routing table would make this much easier than trying to configure different routing tables per application (which it sounds like you only have a single application anyway).

share|improve this answer
Multiple default routes are not really invalid if you have multiple route tables, and have some form of ACLs to select the correct table. Basically you have one default gateway per route table, and then you have to write a rule that sends the instructs the packets to use the right table. – Zoredache Dec 20 '10 at 21:56
Setfib runs an application with one of the alternate routing tables. It does not run a single application (Apache) with multiple default routes, nor can it route TCP sessions based on the source address. If there's a way of doing that, I don't know how. He could run a different instance of Apache per route table, I'm not sure how well Apache would respond to that. I reworded my Answer, but having multiple default routes in a single table is still an invalid configuration. – Chris S Dec 21 '10 at 1:11
Thanks for your comments. I agree that somehow port 80 and specifically apache would need to somehow be attached to work via different routing tables... I think using setfib may be the solution, but somehow this solution has existed before setfib... afterall, aren't Cisco switches/ routers based on freeBSD and doing such configurations as I need? – user20010 Dec 21 '10 at 22:12
Cisco, Juniper, Apple's OSX, NetApp, and more have all used large chunks of FreeBSD; but none of them use the OS wholesale to my knowledge. – Chris S Dec 22 '10 at 3:42
Thanks Chris. I am going to work on this little project some more today. I'll get more details of what I've tried, by this evening. – user20010 Dec 22 '10 at 15:21

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.