Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Freebsd as simple router

Posted on 2014-03-21
4
Medium Priority
?
337 Views
Last Modified: 2016-02-11
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 10.10.10.1 255.255.255.0
em1 is 192.168.0.103 255.255.255.0

default route is 192.168.0.1

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

TEST pc is 10.10.10.2, its default route is 10.10.10.1

Can ping from ZFSguru to 10.10.10.2 AND to 192.168.0.1 AND to 8.8.8.8

can ping from TEST to 10.10.10.1 AND to 192.168.0.103

Can NOT ping from TEST to 192.168.0.1 or to 8.8.8.8

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

Any ideas what's going on here? any suggestions?
0
Comment
Question by:1_21gigawatts
  • 2
  • 2
4 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 39947927
Based on what you have posted I am assuming that the 192.160.0.0/24 network is the network that is actually connected to the Internet.

Does the router that is connected to the Internet have a route for 10.10.10.0/24 that points to 192.168.0.103?

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

You need to configure a route on your Internet router for 10.10.10.0/24 that points to 192.168.0.0/24.
0
 

Accepted Solution

by:
1_21gigawatts earned 0 total points
ID: 39948531
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

0
 
LVL 57

Expert Comment

by:giltjr
ID: 39948543
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 10.10.10.0/24 subnet will appear as if they are on the 192.168.0.0/24 subnet, because they will be NAT'ed to a 192.168.0.0/24 address.

If that provides you with what you needed, great.  Just wanted to point out that you are not routing.
0
 

Author Closing Comment

by:1_21gigawatts
ID: 39961065
This did the job.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question