ethertap (for mol) in 2.4.x ?


Subject: ethertap (for mol) in 2.4.x ?
From: R Shapiro (reshapiro@mediaone.net)
Date: Mon Feb 05 2001 - 07:12:46 MST


My network configuration is such that I can only get networking going
in mol by using ethertap + nat. Since I have one ethernet card and
one address that I get via dhcp, the only way I know of to get
networking in mol and linux simultaneously is to set up an ethertap on
a private net; and then to give MacOS under mol an address in that
same private net with the ethertap address as the router.

This worked ok with 2.2 kernels. In 2.4, ethertap is considered
obsolete. There's still kernel code available and it still seems to
work in a limited way, but it doesn't work at all with mol, at least
as far as I can see. It's possible the ethertap is ok and I've gotten
the nat wrong, since I'm now using iptables instead of ipchains and
I'm not really familiar with nat in iptables (see below). But I don't
think that's the source of the problem.

My question is, can ethertap be used in this way in 2.4? If it can't,
is there another solution?

Fwiw, my old ipchains nat rules were as follows:

  ipchains -M -S 7200 10 160
  ipchains -A forward -i $DEVICE -s $LOCALNET -j MASQ
  ipchains -A output -i $LOCALDEV -s $ANY -d $LOCALNET -j ACCEPT
  ipchains -A input -i $LOCALDEV -s $LOCALNET -d $ANY -j ACCEPT

The new iptables rules are

  iptables -t nat -A POSTROUTING -o $DEVICE -s $LOCALNET -j MASQUERADE
  iptables -A OUTPUT -o $LOCALDEV -s $ANY -d $LOCALNET -j ACCEPT
  iptables -A INPUT -i $LOCALDEV -s $LOCALNET -d $ANY -j ACCEPT

I also tried replacing the first iptables rule with:

  iptables -t nat -A POSTROUTING -o $DEVICE -s $LOCALNET -j SNAT --to $IPADDR

$DEVICE is eth0, $ANY is any/0, LOCALDEV is tap0, LOCALNET is
192.168.1.0/24, IPADDR is the eth0 address, which comes from a dhcp
server. The final two rules in both cases are there so that my
firewall doesn't block the localnet traffic.

The ethertap is configured via

  ifconfig tap0 192.168.1.1 netmask 255.255.255.0 up arp
  route add -host 192.168.1.1 tap0

-- 
reshapiro@mediaone.net



This archive was generated by hypermail 2a24 : Mon Feb 05 2001 - 07:13:39 MST