Re: PPP with IP masquerading over a null modem
Hi Nathaniel,
As nobody seems to be responding to your question, I'll give it a try.
I'm using IP masquerading the other way round (with a masqueraded
ethernet connected to the Net via PPP) and I'm by far no expert at
networking, but maybe this helps.
On Sun, May 16, 1999 at 04:52:18PM -0500, tigerchild wrote:
> I'm trying to connect two machines, near and far, via a null modem
> plugged in to /dev/ttyS0 on each, using PPP and IP masquerading so
> they can share my ethernet connection. For IP masquerading, I'd like
> the near machine to be 192.168.1.1 and the far machine to be
> 192.168.1.2. My lan is Class-C.
>
> Each machine is configured to plug into my lan, but I only have one
> IP address so only one can use the lan at a time.
Do you want to be able to connect both machines directly to the LAN,
masquerading the other, or is it enough to have one of the two
masquerading the other permanently ? I'll assume the latter, with
*near machine* connected to the LAN.
> /etc/ppp/options.ttyS0:
>
> *near machine*:
> /dev/ttyS0
> persist
> bsdcomp 15,15
> crtscts
> 115200
> asyncmap 0
> local
> lock
> 192.168.1.1:192.168.1.2
> -pap
> *far machine*:
> /dev/ttyS0
> persist
> bsdcomp 15,15
> crtscts
> 115200
> asyncmap 0
> defaultroute
> local
> lock
> 192.168.1.2:192.168.1.1
> -pap
I can't say for sure if this will work, but it looks OK. Test it and
see if it works. You might want to use the `silent' option on *near
machine* and let *far machine* initiate the connection.
> Routing tables:
>
> *near machine*:
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> localnet * 255.255.255.0 U 0 0 0 eth0
> default x.x.x.1 0.0.0.0 UG 1 0 0 eth0
>
> *far machine*:
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> localnet * 255.255.255.0 U 0 0 1 eth0
> 127.0.0.0 * 255.0.0.0 U 0 0 1 lo
> default x.x.x.1 0.0.0.0 UG 1 0 1 eth0
>
> where x.x.x.1 is my lan's gateway.
*near machine* looks OK. When the PPP link is up, a route to *far
machine* should be added automatically.
On *far machine*, I think you will only need the loopback route set
(someone correct me if I'm wrong). pppd will set up a default route to
*near machine*, which will then forward connections to the LAN or your
gateway.
> Interface configs:
>
> *near machine*:
> eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
> inet addr:x.x.x.x Bcast:x.x.x.255 Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:13952 errors:0 dropped:0 overruns:0 frame:0
> TX packets:4880 errors:0 dropped:0 overruns:0 carrier:0
> collisions:91 txqueuelen:100
> Interrupt:3 Base address:0x240
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:3924 Metric:1
> RX packets:8 errors:0 dropped:0 overruns:0 frame:0
> TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
>
>
> *far machine*
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
> UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1
> RX packets:2 errors:0 dropped:0 overruns:0 frame:0
> TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
> Collisions:0
>
> eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
> inet addr:x.x.x.x Bcast:x.x.x.255 Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:10 errors:0 dropped:0 overruns:0 carrier:10
> Collisions:0
> Interrupt:9 Base address:0x300
>
> where x.x.x.x is my IP and x.x.x.255 is my lan's broadcast address.
I suppose these are working now, so you won't need to change them. You
don't need the eth0 interface on *far machine*, though.
> The near machine is a potato running kernel 2.2.8 with IP
> masquerading enabled and IPMasq modules loaded, the far machine is
> running slink with the default kernel 2.0.36 and IPMasq modules
> loaded.
You won't need IP masquerading on *far machine*, so you can remove the
modules there. On *near machine*, I suggest installing the ipmasq
package, which worked out of the box here.
> I'm not sure of what changes need to be made to the routing tables
> and the interface configs, other PPP files I need to configure, and
> startup files that I should be modifying to make these changes
> sticky (/etc/init.d/network ?).
The routes are set usually set up in /etc/init.d/network, and you
could put the pppd calls into this file as well, I suppose (although
there is a /etc/init.d/ppp script you might want to look at).
> I am not a complete newbie...but take it slow =).
>
> Any help is greatly appreciated.
>
> Thanks in advance!
>
> Nathaniel
HTH, Robert
--
Robert Vollmert rvollmert@gmx.net
Reply to: