Solved

Freebsd as simple router

Posted on 2014-03-21
4
312 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
This did the job.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now