Solved

Freebsd as simple router

Posted on 2014-03-21
4
315 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
slow vpn connection 9 63
Martian Packets Unix 5 50
access vs trunk with voice vlan 2 41
ERR_NAME_NOT_RESOLVED 7 19
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

815 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

8 Experts available now in Live!

Get 1:1 Help Now