Fixing the Interface

By default, the dtcpc, dtcps and dtcpclient do create/destroy an interface to be used for a tunnel. However, you may want to get an information of a tunnel interface by MRTG, or you may want to configure filterling rule to a tunnel interface. In such cases, you may want to fix an interface to be used for a tunnel.

There are two issues to do this:

  1. Using a particular interface, and
  2. Providing an interface in advance, and don't destroy it.

- Using a Particular Interface

The dtcpc uses an interface specified by -i option. For the dtcpclient, you can specify tunif variable in dtcpclient_script.conf.

Basically, the dtcps uses an interface dynamically within the interfaces specified by -i option. But, you can specify a particular interface for a user by 3rd field in routetable. For example, if your routetable has following line:

hoge		3ffe:505:9000::/48	gif10
when user hoge connects to your dtcps, gif10 will be used for him explicitly.

Here, there shouldn't be same interface in routetable. Further, you need to pay attention to don't overlap with the interfaces specified by -i option. For example, if you specify `-i gif20', since the dtcps will try to use gif20 and later, you can specify gif0 - gif20 in routetable.

- Prevent Destroying an Interface

When an interface is destroied, an index of an interface will be changed. Then, SNMP will not be able to chase an interface.
You can specify an interface name instead of OID for a target of MRTG. However, it seems that MRTG cannot chase an interface. even on this case.

Both dtcpc and dtcps have -o option which prevent from destroying an interface. Since dtcpclient itself doesn't configure a tunnel, dtcpclient doesn't have such an option. But, you can specify cloned_interface_keep="YES" in dtcpclient_script.conf, instead.

Though ether dtcpc, dtcps and dtcpclient create necessary interface dynamically, you may think it is too late. It is a good idea to create necessary interfaces at boot.
Under FreeBSD, you can specify cloned_interfaces in /etc/rc.conf for this purpose. For example, if you want to provide gif0, gif1 and gif2 at boot, you can specify it as follows:

cloned_interfaces="gif0 gif1 gif2"


All Rights Reserved, Copyright (C) 2004 Hajimu UMEMOTO
Last Modified Jun 15, 2004
ume@mahoroba.org