Solved

Freebsd as simple router

Posted on 2014-03-21
4
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

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

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month7 days, 16 hours left to enroll

617 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