MOL & TCP/IP + DHCP = ?

Keary Suska mol-general@lists.maconlinux.org
Sat, 20 Apr 2002 20:03:34 -0600


on 4/20/02 7:24 PM, mietek@icpnet.pl purportedly said:

> Hello,
> 
> I'm new to this list, so let me introduce myself briefly - I'm a
> Linux newbie. :) And I'm desperately trying to enable TCP/IP access under
> MOL, using a single IP provided by DHCP for both MacOS and Linux.
> 
> I searched the archives, and the web in general, but I couldn't find
> anything clear enough. The "ethernet dhcp, mol ethertap, doesn't work"
> thread was quite informative, but I have no idea how to configure ethertap.
> 
> Could some kind soul offer me a step-by-step guide?

Quoted from the MOL developer:

> Indeed. The TUN/TAP device must be configured at runtime.
> Currently mol runs the script '/usr/lib/mol/bin/tunconfig'
> (if it exists). The following config file works for me:
> 
> ---------------------------------------------------------------
> #!/bin/bash
> /sbin/ifconfig tun0 192.168.1.1
> /sbin/iptables -D POSTROUTING -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -j
> MASQUERADE >& /dev/null
> /sbin/iptables -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -A POSTROUTING -j
> MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward
> ---------------------------------------------------------------
> 
> The /etc/molrc file should contain
> 
> netdev:    tun0 -tun
> 
> and optionally (for AppleTalk)
> 
> netdev: eth0 -sheep
> 
> The MacOS TCP/IP panel should be configured according to
> 
> IP:        192.168.1.2
> Netmask:    255.255.255.0
> Gateway:    192.168.1.1
> 
> TUN/TAP as well as iptables and masquerading needs to be on in the
> kernel.

You will have to check if TUN/TAP support is compiled in your kernel (or as
a loadable module). It is *not* by default in YDL 2.1, kernel 2.4.x. The IP
filter modules are, however, except you will have to find and install the
iptables program. Use Google to search for "IP masquerade howto" for the web
site by this name that will give you a step-by-step on masquerading.

Be warned, this is not newbie territory. You may have quite a learning curve
to be able to do this.

An alternative is that some ISP's allow more than one IP to be used by a
single connection. It will be worth your while to contact your ISP about
this. If you can, you can use DHCP in Mac OS to get it's own IP. This is
what I ended up doing, as I didn't have the time for a different solution.
In my experience, it can take a minute or two or longer for the Mac OS to
get an IP using DHCP under MOL. I don't know why, if this is a MOL problem
or something with my ISP. But if you don't get immediate results, it may be
worth waiting a few minutes to see if TCP/IP eventually comes up.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"