general networking question

r. may mol-general@lists.maconlinux.org
18 Jun 2002 20:15:37 -0400


Ethertap is obsolete now.  Try the tun way of networking, there are
postings about this in the archives, but basically it goes like this:

[copy and pasted from other emails]

Subject: Re: mol networking + 2.4.8
From: Samuel Rydh <samuel@ibrium.se>
Date: Fri, 24 Aug 2001 00:06:25 +0200

There are several possibilities.


1. Network configuration in /etc/molrc:

netdev: eth0 # this is for AppleTalk
netdev: tun0 -tun # this is for TCP/IP


2. Kernel configuration:

Network device support
======================================================================
CONFIG_TUN (Network device support -> Universal TUN/TAP device driver
support)

Networking options
======================================================================
CONFIG_NETFILTER (Networking options -> Network packet filtering)

Networking options -> Netfilter Configuration:
======================================================================
CONFIG_IP_NF_CONNTRACK (Connection tracking)
CONFIG_IP_NF_IPTABLES (IP tables support)
CONFIG_IP_NF_NAT (Full NAT)
Some of the other options in this group is probably also needed,
(but the default setting should be OK).

I.e. this is a normal masquerading setup except for adding
the the tun support.


3. Create the file /usr/lib/mol/bin/tunconfig

It should look like
---- cut here ---
#!/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
--- end ----

Make it executable (chmod 755 /usr/lib/mol/bin/tunconfig)


4. Optionally add the following to /etc/hosts (recommended):

192.168.1.0 tunnetwork
192.168.1.1 tun
192.168.1.2 tun-mol


5. Configure TCP/IP in MacOS:

Select "Ethernet, port 1"
IP: 192.168.1.2
netmask: 255.255.255.0
gateway: 192.168.1.1
nameserver: whatever is used in linux


6. Configure AppleTalk in MacOS

Select "Ethernet, port 2"


7. Optionally add the following to /etc/hosts.allow

ALL: 192.168.1.2


Some comments:
==============

- The tun0 device can't be configured until MOL is started.
(This is the reason why MOL calls the configuration script)

- MOL must be started by root (at least for now - the
script won't have root privileges otherwise).

- It is only necessary two specify two different netdev lines
in /etc/molrc if AppleTalk is to be used.

- The configuration assumes the default policy is
ACCEPT (can be examined by doing '/sbin/iptables -L'.

- The iptables package must be installed.

- Make sure there is a /dev/net/tun device.
(Can be created with 'mkdir /dev/net ; mknod /dev/net/tun c 10 200').

	---***---

From: 	Samuel Rydh <samuel@waltari.theophys.kth.se>
Subject: 	Re: Missing resource: 'tunconfig_script'
Date: 	16 Apr 2002 15:34:08 +0200

>I just compiled and installed 0.9.62 and everything is working just
fine
>except for the tun interface. I copied both molrc (netdev: tun0 -tun)
and
>tunconfig (as posted earlier by Samuel) from my previous installation,
but
>as soon as I 'startmol' I get this in the log:
>
>---> Missing resource: 'tunconfig_script'
>Ethernet Interface (port 1) 'tun-<tun0>' @ XX:XX:XX:XX:XX:XX
>Ethernet Interface (port 2) 'sheep-<eth0>' @ XX:XX:XX:XX:XX:XX
>
>And then of course all the regular tun things doesn't work.
>
Add the line

tunconfig_script: ${bin}/tunconfig

to your /etc/molrc file. This will tell MOL to run the script
/usr/[local/]lib/mol/0.9.62/bin/tunconfig in order to
configure tun0.

	---***---

That should get you going.  Personally I put my tunconfig script in
/usr/lib/mol/tunconfig.  This way when I update mol I don't have to make
a new file.

Hope this helps.

r.May