Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting up TAP interface at boot?

852 views
Skip to first unread message

Jesse Sheidlower

unread,
Jan 18, 2009, 4:50:07 AM1/18/09
to

Where's the right place to set up a TAP interface at boot
time? When my system's up, I usually run "tunctl -t tap0" as
root, but I'd like this to be created automatically. I do
have an entry in /etc/network/interfaces to configure this:

auto tap0
iface tap0 inet static
address 192.168.5.1
netmask 255.255.255.0

but this won't work if the interface doesn't exist, so I end
up having to do everything by hand.

Thanks.

Jesse Sheidlower


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Boyd Stephen Smith Jr.

unread,
Jan 18, 2009, 6:20:07 AM1/18/09
to
On Sunday 18 January 2009, Jesse Sheidlower <jes...@panix.com> wrote
about 'Setting up TAP interface at boot?':

>Where's the right place to set up a TAP interface at boot
>time? When my system's up, I usually run "tunctl -t tap0" as
>root, but I'd like this to be created automatically. I do
>have an entry in /etc/network/interfaces to configure this:
>
>auto tap0
>iface tap0 inet static
> address 192.168.5.1
> netmask 255.255.255.0
>
>but this won't work if the interface doesn't exist, so I end
>up having to do everything by hand.

Create and statically configure the device during the post-up of the
interface it depends upon. For example, I have a OpenVPN that I want to
come up on eth0. I added the line "openvpn $vpn_name" to the
configuration for the eth0 device.

If you are not doing openvpn, you may have to write your own script and use
the normal /etc/network/if-up.d interface.

If this is something to do with virtualization, so may want the device
create (and configure) script attached to the "lo" device.

If you are happy with having to run a command as root to create the device,
you could also run "ifup tap0" immediately after that command to save a
little manual work.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
b...@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/

signature.asc

Andrew Malcolmson

unread,
Jan 18, 2009, 1:40:11 PM1/18/09
to
Jesse Sheidlower wrote:
> Where's the right place to set up a TAP interface at boot
> time? When my system's up, I usually run "tunctl -t tap0" as
> root, but I'd like this to be created automatically. I do
> have an entry in /etc/network/interfaces to configure this:
>
> auto tap0
> iface tap0 inet static
> address 192.168.5.1
> netmask 255.255.255.0
>
> but this won't work if the interface doesn't exist, so I end
> up having to do everything by hand.
>
> Thanks.
>
> Jesse Sheidlower
>

To bring up a TAP interface, optionally readable by a non-root user, do:

iface mytap inet static
address 10.0.3.1
netmask 255.255.255.0
pre-up /usr/sbin/tunctl -u username -t mytap

0 new messages