*BSD News Article 96488


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!newsfeed.internetmci.com!in1.uu.net!204.254.98.4!mint.net!darren
From: darren@Quint.somtel.com (Darren Henderson)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: [Help] natd & routing configuration
Date: 30 May 1997 01:01:17 GMT
Organization: Maine InternetWorks
Lines: 95
Message-ID: <5ml8st$1ql$1@ruby.mint.net>
NNTP-Posting-Host: quint.somtel.com
X-Newsreader: TIN [version 1.2 PL2]
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:41843



Trying to get natd running with little success... Sorry for the length but
I want provide enough information.

Here's the situation.


FreeBSD 2.2.1
natd 1.4
kernel mode ppp

I want 10.0.0.2 to get to the internet via my unix box which has a
dedicated dialup to my isp via ppp.


                  ed0
     10.0.0.2 ------------ 10.0.0.1            ppp0
                           206.139.114.254 ----------- 206.139.114.1 


From /etc/sysconfig


network_interfaces="ed0 ppp0 lo0"
ifconfig_ppp0="inet 206.139.114.254 netmask 255.255.255.0"
ifconfig_ed0="inet 10.0.0.1 netmask 255.255.255.0"
ifconfig_lo0="inet 127.0.0.1"

static_routes="multicast loopback"
route_multicast="206.139.114.254 -netmask 0xf0000000 -interface ${hostname}"
route_loopback="${hostname} localhost"

(Question: Do I need these static routes? Should there be one similar to
the one labled multicast for the 10.0.0.1 address?)

defaultrouter="206.139.114.1"
router="routed"
gateway="YES"
firewall="YES"


From rc.filewall
firewall_type=open
/sbin/ipfw -f flush
/sbin/ipfw add 2000 divert 6668 all from any to any via ed0

/etc/services had natd defined for 6668. Note that the directions in
natd's man page doesnt work, ipfw chokes if I use natd instead of 6668

Ok, here's happens when I ping a machine on the Internet side from the
10.0.0.2 box using  natd -s -m -v -n ed0

In  [UDP]  10.0.0.2 -> 206.139.114.18 aliased to
           10.0.0.2 -> 206.139.114.18
In  [UDP]  10.0.0.2 -> 198.6.1.1 aliased to
           10.0.0.2 -> 198.6.1.1
 
Its trying to get to the name server but notice it doesn't do anything for
aliasing. I get the same result with natd -s -m -v -a 206.139.114.254

If I change the ipfw rule to

ipfw add 2000 divert 6668 all from 10.0.0.2 to any

and go back to the -n ed0 invocation of natd I get

In  [UDP]  10.0.0.2 -> 206.139.114.18 aliased to
           10.0.0.2 -> 206.139.114.18
Out [UDP]  10.0.0.2 -> 206.139.114.18 aliased to
           10.0.0.1 -> 206.139.114.18

If I do it with the natd -a invocation I get

In  [UDP]  10.0.0.2 -> 206.139.114.18 aliased to
           10.0.0.2 -> 206.139.114.18
Out [UDP]  10.0.0.2 -> 206.139.114.18 aliased to
           206.139.114.254 -> 206.139.114.18
I
Finally.... somthing is actually getting aliased, of course it doesn't
work correctly but.... :) Looks like I'm half way there but I would need
another ipfw rule and I can't see what it would be.

Anyhow... anyone have any advice on the propper configuration for my
situation? Do I have my static routes set up correctly?

What I suspect is that I have the multihomed aspects of this messed up and
there should be some kind of routing that equates the 10.0.0.1 address
with the 206.139.114.254 address.

Eagerly awaiting any thoughts on the matter. 

______________________________________________________________________________
Darren Henderson                                      darren@jasper.somtel.com
                                                            dhenderson@bix.com