User`s manual
IA260-261-262 EM-2260 LX User’s Manual  Managing Communications 
  address ) IPADDR=$f2 
  ;; 
   netmask ) NETMASK=$f2 
  ;; 
  broadcast ) BROADCAST=$f2 
  ;; 
  esac 
  done  
    break 
  fi 
 done < /etc/network/interfaces 
} 
# get the ip address of the specified interface 
mname= 
module_up() 
{ 
 oIFS=$IFS 
 IFS=‘ 
 ‘ 
 FOUND=“no” 
 for LINE in `lsmod` 
 do 
  TOK=`echo $LINE | cut -d’ ‘ -f1` 
  if [ “$TOK” = “$mname” ]; then 
  FOUND=“yes”; 
  break; 
  fi 
 done 
 IFS=$oIFS 
 if [ “$FOUND” = “no” ]; then 
  modprobe $mname  
 fi 
} 
start() 
{ 
 ifcfg_vpn 
 if [ ! \( -d “/dev/net” \) ]; then 
  mkdir /dev/net 
 fi 
 if [ ! \( -r “/dev/net/tun” \) ]; then 
  # create a device file if there is none  
  mknod /dev/net/tun c 10 200 
 fi  
 # load modules “tun” and “bridge”  
 mname=tun 
 module_up 
 mname=bridge 
 module_up 
 # create an ethernet bridge to connect tap devices, internal interface  
 brctl addbr br0 
 brctl addif br0 $iface 
 # the bridge receives data from any port and forwards it to other ports.  
i=`expr 0` 
 while : 
 do 
  # generate a tap0 interface on tun   
  openvpn --mktun --dev tap${i} 
  # connect tap device to the bridge 
  brctl addif br0 tap${i} 
  # null ip address of tap device 
4-21










