SunQuest
           BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 28th, 2005, 09:53 PM
afu afu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 2 afu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 38 sec
Reputation Power: 0
ipfw problems

Hello, I just migrated to FreeBSD from Linux and I was having some problems finding information on how to masquerade private internal IPs on the windows machine to a external IP configured the rl0 interface of the FreeBSD gateway. I have googled every site but I havn't found anything regarding my problem.
My network is like so(Any comments accepted):
3 Windows machines -> Wireless Linksys Router -> FreeBSD (PPPoE)-> ADSL -> Internet with a /25 class C block.
The connection between the LAN and internet works fine, but I would like to redirect/forward each of my internal ips to a external IP configured on my rl0 FreeBSD box, were 192.168.0.1 would show up as 70.x.x.250 to the outside world instead of 70.x.x.254 which is my default gateway IP. Every IP for my windows machines shows up as the gateway IP to the outside world, which really bothers me.
I know how to do this sort of thing in Linux, it goes something like dis:
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.1 -j SNAT --to 70.x.x.250

Does anyone know how to do this similar command with ipfw??

You do this for every private ip on your LAN that you want to alter the source packets from and redirect them to a single destination IP.

My natd.conf consist of this:
alias_address 70.x.x.250
redirect_address 192.168.0.1 70.x.x.250
and i run natd -f /etc/natd.conf

Added the following with ipfw:
ipfw add fwd 192.168.0.1 ip from any to 70.x.x.250 via tun0

I'm probably doing something wrong with the ipfw, any help appreciated and thank you for your time.

Reply With Quote
  #2  
Old July 29th, 2005, 04:05 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
Originally Posted by afu
Added the following with ipfw:
ipfw add fwd 192.168.0.1 ip from any to 70.x.x.250 via tun0

I'm probably doing something wrong with the ipfw, any help appreciated and thank you for your time.

The FreeBSD handbook (1, 2) contains a step by step tutorial.

NAT isn't done by forwarding ("fwd") but using "divert" sockets to send the packets to the userspace nat daemon:
"ipfw add divert natd ip from any to 70...."

hth,
M.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > ipfw problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway