Subject: Re: How to make a server?
To: None <danielh@uol.com.br>
From: David Brownlee <abs@anim.dreamworks.com>
List: port-i386
Date: 05/24/1997 13:03:35
	To answer the second question first:

		You can connect two machines together via serial ports
		and run ppp or slip, instead of using an ethernet card.
		Linking more than two computers using serial cables
		becomes... more complex :)

	To use a machine with a modem as a gateway for one or more other
	local machines:

		a) If you can get more than one static IP address from
		   your ISP its simple - just set them up and put the
		   gateway's name in /etc/mygate on the other machines.

		b) If you can get one static IP from your ISP its still
		   possible. You need to use ipnat to translate 
		   connections from your local machines so that they
		   appear to come from the machine with the modem.
		   (See notes below).

		c) If you can only get a dynamic address.. then its a
		   little 'more interesting'. Assuming you are willing to
		   start pppd manualkly when you want to connect then it
		   shouldn't be too difficult to make /etc/ppp/ip-up run
		   ipnat with the appropriate arguments automatically. If
		   anybody really wants notes on this, email me & I'll
		   see if I can come up with some :)


	Brief notes on ipnat (revision3 :)
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        Ipnat performs Network Address Translation (NAT), also known as
        IP-Masquerading for the less well informed.

        Ipnat is part of ipfilter, which is distributed with
	NetBSD/-current, and can be added to a 1.2 or 1.2.1 setup.

        There is a webpage for ipfilter at:
                http://coombs.anu.edu.au/~avalon/ip-filter.html

        Assuming you can get a static address allocated by your ISP:

        a) Have a gateway host (eg: machine with ethernet and modem)
        b) Number your internal machines on a reserved network
               (eg 10.x.x.x
                    ethernet address of gateway 10.0.0.1
                    ethernet address of 1st local host 10.0.0.2
                    etc)
        d) Ensure /etc/mygate on all other machines contains the
           internal network address of the gateway (10.0.0.1)
        e) On the gateway:
           Create an /etc/ipnat.conf file:
           map ppp0 10.0.0.0/8 -> X.X.X.X/32 portmap tcp/udp 10000:20000
               (Where X.X.X.X is the address of your ppp0 interface,)
           Run 'ipnat -f /etc/ipnat.conf'.
           Run 'sysctl -w net.inet.ip.forwarding=1' (enable routing)

        Then just run pppd as normal, and try to telnet out or web browse
        from another local machine.

        Once you have this working you probably want to add the pppd
	startup, ipnat, and sysctl to the end of /etc/rc.local.

                David/abs               abs@anim.dreamworks.com

.---- I've been too drunk to love ----.-- I've been too drunk to remember -.
|          too drunk to care          |    the hell of the night before    |
|  looked like death, felt like hell  |   I've been drinking myself blind  |
`------ been the worse for wear ------'-- and still I'll drink some more --'

On Sat, 24 May 1997 danielh@uol.com.br wrote:

> 	Dear people from NetBSD,
> 
> 	I have to network two computers using one as a PPP server linked through 
> a phone line to my Internet Provider and other equipped with Windows 95 and no 
> modem.
> 	How can I do this?
> 	And how can I link the PPP server with another computer, an Amiga 
> without having to make a connection through Ethernet interfaces?
> 
> 	Thanks for your help,
> 
> 	Daniel.
>