----- Original Message -----
From: "Edouard Gomez" <[EMAIL PROTECTED]>
To: "Mailist Speedtouch USB" <[EMAIL PROTECTED]>
Sent: Wednesday, April 14, 2004 11:08 PM
Subject: [speedtouch] TUN devices in order to do VC MUX


>
> Hey hey,
>
> As i'm a new happy free.fr user, i had to learn how to use VC MUX with
> the kernel drivers. However, i'm wondering if we could not implement VC
> MUX as well in user space using a TUN device.
>
> For RFC1483 bridging, the driver uses a TAP device, and i wonder if
> using a TUN device isn't just enough in order to do the VC mux thingy
> in user space as well, w/o too many changes in the code.
>
> But i have a  problem, the kernel headers don't tell much  how to set up
> everything to up the TUN  device the assign it an IP/Gateway/Mask. Maybe
> someone can enlighten me with his network API knowledge ?
>
> It would be cool to be able to do:
> pppoa3 -vcmux -ip xxx.xxx.xxx.xxx -gw yyy.yyy.yyy.yyy -vci 8 -vpi 36
>
> --
> Edouard Gomez
>
For ECI driver, we do this way on IPCop
First
 if [ "$PROTOCOL" = "RFC1483" ]; then
  case "$ENCAP" in
      0) ECIMODE="LLC_SNAP_RFC1483_BRIDGED_ETH_NO_FCS"
   ;;
      1) ECIMODE="VCM_RFC_1483_BRIDGED_ETH"
   ;;
      2) ECIMODE="LLC_RFC1483_ROUTED_IP"
   ;;
      3) ECIMODE="VCM_RFC1483_ROUTED_IP"
   ;;
      *) msg "Unknown encapsulation: $ENCAP"
   exit 1
   ;;
  esac

  # Start pppoeci
  if [ "$ENCAP" = "0" -o "$ENCAP" = "1" ]; then
   ECIIF="tap0"
  else
   ECIIF="tun0"
  fi
  /sbin/insmod tun
  /usr/bin/pppoeci -alt 4 -vpi $VPI -vci $VCI -vendor 0x$VID2 -product
0x$PID2 -mode $ECIMODE
  wait_for_iface $ECIIF
  /sbin/ifconfig $ECIIF up
  exit $?
 fi
and secondly (perl script)
  } elsif ($pppsettings{'METHOD'} eq 'STATIC') {
   my @staticcommand = ('/sbin/ifconfig');
   push(@staticcommand, ($iface, $pppsettings{'IP'},'netmask',
$pppsettings{'NETMASK'}));
   if ($pppsettings{'BROADCAST'} ne '') {
    push(@staticcommand, ('broadcast', $pppsettings{'BROADCAST'}));
   }
   system (@staticcommand);
   system ("/sbin/route","add","default","gw",$pppsettings{'GATEWAY'});
   system ("/bin/touch", "${swroot}/red/active");
   system ("/etc/rc.d/rc.updatered");
   exit 0;

You may have another problem and this is the reason I show you the static
METHOD part.
TUN interface may not be supported by you dhcp client. It is not supported
by dhcpcd v1.3.22-pl4


Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]

        

Reply via email to