starting tap0 interface at boot time?

Dear all,

I wish to use a tap interface before my jails start, because I use this interface as my jail interface. What do I have to write in /etc/rc.conf in order for it to be created at boot time? (ifconfig_tap0="10.230.0.1/24" does not work; the interface needs to be created first).

Thank you all for your time in advance.
 
What exactly is running on tap0? (the interface can be used for multiple purposes).
 
I am using tap0 as the jail interface:

excerpt from /etc/fstab:

Code:
jail_redmine_interface="tap0"

But apart from my specific configuration, I have always been curious about how I can create a virtual interface on boot using /etc/fstab and not /etc/rc.local (which in my case -I think- it wouldn't help, since -if I remember correctly- rc.local has a lower priority than jail in rc).

Thank you for your immediate answer, you're even faster than I remembered :) !
 
mamalos said:
I am using tap0 as the jail interface:
Yes, I understood that. But what creates the tap0 interface? There are various ways of using that interface.
 
Sorry, I don't understand what you mean...Nothing creates the specific interface, and this is exactly what my problem is. I wish to create it "automatically", somehow, through the use of /etc/rc.conf without running any additional service (instead of having to run ifconfig tap0 create manually).
 
If you aren't going to need any networking, why don't you bind your jails to lo1 (a clone off of lo0)?
 
I need networking, but I wish to use natting on my jails (and other firewall features through pf), and not use alias addresses on my outgoing interface. Isn't there a way to tell the kernel to start an interface through rc.conf?
 
mamalos said:
I need networking, but I wish to use natting on my jails (and other firewall features through pf), and not use alias addresses on my outgoing interface.
Which you can also do with a cloned lo1.
 
In /etc/rc.conf:
Code:
cloned_interfaces="lo1"
ifconfig_lo1="10.230.0.1/24"

You could try this with tap0 but I'm not sure it'll work. It should work with lo1.

From here you can use PF to forward ports from the 'outside' to lo1.
 
Thank SirDice, worked like a charm.

By the way, on my old laptop (FreeBSD) I used to have cloned interfaces for my vlan setup. Now I see that in order to configure my tap interface, I had to use the same variable. Where can I find more information with respect to FreeBSD's cloned interfaces?

Thanx again!
 
mamalos said:
Where can I find more information with respect to FreeBSD's cloned interfaces?
Tricky. With things like this I usually just start reading the system's rc scripts.
 
:)

Which was exactly what I had been doing before you sent me your last message, and I was wondering what these clone interfaces were in /etc/network_subr; hoped to find a better way though :)

Thanks again for all the immediate help!
 
I use tap to bridge virtual networks with dynamips.

To create it automatically I used:
# echo -n > /dev/tap0

This was needed one time only.

Also needed is
Code:
if_tap_load="YES"
in /boot/loader.conf.

I don't know if this helps in your case.
 
Back
Top