Subject: Re: a couple questions
To: SamMaEl <rimsky@teleport.com>
From: Paul Goyette <paul@whooppee.com>
List: port-mac68k
Date: 12/27/1997 21:03:09
On Sat, 27 Dec 1997, SamMaEl wrote:

> 	1) Is there any sort of FAQ o setting up IPNAT? I'm trying to use
> some of the scripts I've seen in various posts to the list, but none have
> worked for me thus far. Here is my setup:
> 
> 	hobbes @ 10.0.0.3 # IIci running NetBSD
> 		broadcast 255.255.255.10

Here's one problem:  if you're running with a netmask of 255.255.255.255
then your broadcast address should be 10.0.0.255

> 	brahms @ 10.0.0.1 # Q630 generally running MacOS (no CS ethernet
> 			  # yet under NetBSD 
> 	yoda   @ 10.0.0.2 # PB540c (no FPU, and LC040, so no NetBSD 8-()
> 	newton @ 10.0.0.4 # IIcx running MacOS (video card and ethernet
> 			  # card conflicts, so can't ifconfig.... I'll
> 			  # send some info on it later to see if someone
> 			  # can help fix)
> 
> 	* all have a 255.255.255.0 netmask
> 
> 	Hobbes has the PPP connection to the Internet, and I want to route
> those packets to at least Brahms and Yoda so I can use Netscape through
> Hobbes as a gateway. So far.... no luck. It MAY be that I need to figure
> out the domain name stuff. Right now, Hobbes is my internal DNS, and it
> also uses my ISP's DNS. What would be a good way to set up the TCP/IP
> settings on my MacOS machines.... use Hobbes as a primary DNS and my ISP
> as secondary? or vice versa?

Well, I would set up Hobbes as a forwarding (cache-only) name server,
and point Brahms & Yoda to the 10.0.0.3 address.

> 	Right now, here's my nat-up script (called from /etc/ppp/ppp-up
> after I get my IP address from my ISP.
> 
> #!/bin/sh
> #
> # nat-up - setup the nat with ppp
> #
> 
> address=`ifconfig ppp0 | tail -n 1 | awk '{print $2}'`
> echo Current IP address is $address
> echo Cleaning out IPNAT
> ipnat -F
> ipnat -C
> ipf -E
> echo Setting up IPNAT for IP address $address
> echo "map ppp0 10.0.0.3/24 -> $address/32 portmap tcp/udp 10000:65000" |
> ipnat -f -
> # the above is one line
> echo "map ppp0 10.0.0.3/24 -> $address/32" | ipnat -f -
> 
> --------
> 	and my nat-down (called from /etc/ppp/ppp-down)
> 
> #!/bin/sh
> #
> # nat-down - bring down the nat
> #
> 
> ipf -D
> ipnat -C
> 
> -------------

Looks OK to me.  But I only use the line with tcp/udp myself - since you
only have one real, routable address, it doesn't make any sense to try
to ipnat other protocols (eg, ICMP) since and replies will be addressed
only to your gateway machine.  (There's no way for ICMP to know that a
message was destined for the other machines, since there's nothing to
identify the other machines by.)

> 	Do I just need to adjust the IP numbers to reflect my system? Or
> is there something else going on? I've tried using 10.0.0.3 and 10.0.0.0
> for the IP/netmask pair in the map ppp0, but neither has worked. I've
> looked through the ipf ipnat and ipnat.conf man pages and they didn't seem
> to help my understanding much...
> 
> 	2) What would be a good way to set up a serial connection between
> 2 NetBSD machines? I can't use ethernet between Hobbes and Brahms, but I
> could at least use a SLIP/PPP connection between the two. I read something
> about setting it up recently, but I've misplaced all of my old list mails
> 8-( Anyone care to recap? ;-) I've not had any luck so far.... 8-(

-----------------------------------------------------------------------------
| Paul Goyette       | Public Key fingerprint:   | E-mail addresses:        |
| Network Consultant |  0E 40 D2 FC 2A 13 74 A0  |  paul@whooppee.com       |
| and kernel hacker  |  E4 69 D5 BE 65 E4 56 C6  |  paul.goyette@ascend.com |
-----------------------------------------------------------------------------