• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Freebsd as simple router

I have installed ZFSguru, which is really freeBSD with some zfs gui stuff added. It's been a while since my bsd days, and I'm stuck.

I have two NICS.
em0 is
em1 is

default route is

I have added to rc.conf, gateway_enable="YES"

TEST pc is, its default route is

Can ping from ZFSguru to AND to AND to

can ping from TEST to AND to

Can NOT ping from TEST to or to

tracert -d from TEST shows first hop as as it should, but gets no further.

Any ideas what's going on here? any suggestions?
  • 2
  • 2
1 Solution
Based on what you have posted I am assuming that the network is the network that is actually connected to the Internet.

Does the router that is connected to the Internet have a route for that points to

If not then nothing in the network knows how to get to except for your BSD computer because it is connected to both networks.

You need to configure a route on your Internet router for that points to
1_21gigawattsAuthor Commented:
Problem is fixed. What was missing is a configuration for NAT routing in pf.conf. For anyone interest, here's what I came up with. It provides absolutely zero security, but that is OK for this particular installation. It is probably NOT OK for most.

ext_if = "em1"
int_if = "em0"
localnet = $int_if:network

nat on $ext_if from $localnet to any -> ($ext_if)
pass from { lo0, $localnet } to any keep state

Open in new window

I won't object as I'm not 100% what your goal was.

However. your question was how to use FreeBSD as a router.  Your solution is not using FreeBSD as a router, but as a NAT box.

All of the hosts in the subnet will appear as if they are on the subnet, because they will be NAT'ed to a address.

If that provides you with what you needed, great.  Just wanted to point out that you are not routing.
1_21gigawattsAuthor Commented:
This did the job.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now