Article View: comp.os.linux.networking
Article #81Re: SLIP gateway on a local network
From: yeun0001
Date: Fri, 22 Mar 1996 21:09
Date: Fri, 22 Mar 1996 21:09
81 lines
3413 bytes
3413 bytes
tim@maths.tcd.ie (Timothy Murphy) writes:
>Pedro Miguel Sequeira de Justo Teixeira <pmt@hidro1.ist.utl.pt> writes:
>>> I own two UNIX machines connected via Ethernet: A and B.
>>> One system (A) is also connected to internet via SLIP (dynamic IP).
>>> How can i use the SLIP connection also on the other machine (B) ?
>>> I tried (in B) adding a default route to A, it seems that packets are sent but not
>>> received.
>> You must recompile the kernel with the GateWaying
>>option ON (it is off by default) for Machine B.
>Have you actually done this?
>If so, please just tell us what you put in the relevant /etc files.
I think I'll post my method here so someone can try it out:
1. Assume that Machine A has a modem and will be used to dial out and
establish SLIP connection.
2. get "ipfwadm" from ftp://ftp.xos.nl/pub/linux/ipfwadm/
and install the program.
For kernel version 1.3.60 or older, get ipfwadm-1.2.tar.gz
Otherwise, get ipfwadm-2.0beta2.tar.gz.
3. Before we setup the connection, recompile the kernel in Machine A
with CONFIG_FIREWALL, CONFIG_IP_FORWARD, CONFIG_IP_FIREWALL, and
CONFIG_IP_MASQUERADE set to 'y'.
4. Connect A and B via ethernet and assign an IP address to each of them.
(In this case, A is 10.0.0.1, and B is 10.0.0.2)
5. Modify /etc/rc.d/rc.inet1 in Machine A to:
#! /bin/sh
HOSTNAME=`cat /etc/HOSTNAME`
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0
IPADDR="10.0.0.1"
NETMASK="255.0.0.0"
NETWORK="10.0.0.0"
BROADCAST="10.0.0.255"
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/route add -net ${NETWORK} netmask ${NETMASK}
6. Then, modify /etc/rc.d/rc.inet1 in Machine B to:
#! /bin/sh
HOSTNAME=`cat /etc/HOSTNAME`
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0
IPADDR="10.0.0.2"
NETMASK="255.0.0.0"
NETWORK="10.0.0.0"
BROADCAST="10.0.0.255"
GATEWAY="10.0.0.1"
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/route add -net ${NETWORK} netmask ${NETMASK}
/sbin/route add default gw ${GATEWAY} metric 1
7. Execute the 2 scripts to setup local connection.
8. Have Machine A dial out and establish SLIP connection.
9. On Machine A, execute the following commands:
/sbin/ipfwadm -F -p accept
/sbin/ipfwadm -F -a masquerade -S 10.0.0.1 -D 0.0.0.0/0
/sbin/ipfwadm -F -a masquerade -S 10.0.0.2 -D 0.0.0.0/0
10. Machine B should be able to connect to the outside world at this point.
To make it more convenient, edit /etc/resolv.conf to add a
nameserver entry and restart inetd.
Good luck! :)
-- Henry Yeung
--
Henry Yeung = 2015 Riverside Avenue, #203
= yeung@freenet.msp.mn.us = Minneapolis, MN 55454
= hyeung@empros.com = Day: (612)-536-4781
= yeun0001@gold.tc.umn.edu = Home: (612)-321-0382
Technical Details
Message-ID:
<yeun0001.827526406@gold.tc.umn.edu>Path:
arc1-ca.pugleaf.net!gold.tc.umn.edu!yeun0001References:
<314B4C05.7FD76F10@bbs.infosquare.it> <314F99EB.794B@hidro1.ist.utl.pt> <4iujal$32d@hamilton.maths.tcd.ie>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!gold.tc.umn.edu!yeun0001 From: yeun0001@gold.tc.umn.edu Newsgroups: comp.os.linux.networking,comp.unix.admin,comp.unix.misc,comp.unix.questions,comp.unix.amiga Subject: Re: SLIP gateway on a local network Date: 22 Mar 1996 15:09:40 -0600 Organization: University of Minnesota - Twin Cities Message-ID: <yeun0001.827526406@gold.tc.umn.edu> References: <314B4C05.7FD76F10@bbs.infosquare.it> <314F99EB.794B@hidro1.ist.utl.pt> <4iujal$32d@hamilton.maths.tcd.ie> NNTP-Posting-Host: gold.tc.umn.edu