Solved

Freebsd as simple router

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
NFS v4 7 76
Esxi host upgrade 16 99
Active directory DNS integrated question? 7 45
Change subnet - effects on server 14 39
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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 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…

734 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