# FreeBSD 10 several vnet interfaces in one jail



## ro (Dec 17, 2013)

Hi

I'd like to create two vnet interfaces in one jail named "test".

Part of /etc/jails/test.conf:

```
...
jail_test_vnet_interface="epair0b"
jail_test_vnet_interface="epair1b"
...
jail_test_exec_prestart0="ifconfig epair0 create"
jail_test_exec_prestart1="ifconfig bridge0 addm epair0a"
jail_test_exec_prestart2="ifconfig epair0a up"
jail_test_exec_prestart3="ifconfig epair1 create"
jail_test_exec_prestart4="ifconfig bridge1 addm epair1a"
jail_test_exec_prestart5="ifconfig epair1a up"
...
```

Interface epair0b is replaced with epair1b after the jail starts. Can anybody explain to me what's wrong?
10x [? -- mod.]
	^
   Thanks!


----------



## usdmatt (Dec 17, 2013)

I can tell you what's wrong, but not exactly how to fix it. The jail configuration file, just like /etc/rc.conf, is basically a script full of variables. So in these two lines:


```
jail_test_vnet_interface="epair0b"
jail_test_vnet_interface="epair1b"
```

You are setting jail_test_vnet_interface to epair0b, then resetting the same variable to epair1b. Basically the first line here is completely redundant.

I've had a quick glance at the jail startup script and I don't _think_ that it supports setting multiple vnet interfaces (not by simply putting two interfaces into jail_test_vnet_interface at least). I could be wrong here though.

You may have better luck asking on the jail mailing list, unless someone who knows jails inside out happens to come along. The methods to configure and create jails via the rc/jail scripts seems incredibly complicated (as well as changing constantly) and I think it's only the developers who really know how it all works. They may have some ideas on how you can use the prestart/start/etc. variables to achieve what it is you're trying to do.


----------



## ro (Dec 17, 2013)

Thank you for the detailed response. I will think about how to fix it.


----------

