jails cbsd & tun1

I already use tun0 for a ppp connection
But cbsd want to assign tun0 to a jail.
How can I force cbsd to use tun1 and not tun0

Because i receive the error:
Code:
Starting jail: jailc1, parallel timeout=0
ifconfig: ioctl (SIOCAIFADDR): Destination address required
jail: jailc1: /sbin/ifconfig tun0 inet 10.0.0.1 netmask 255.255.255.255 alias: failed
jstart done in 3 seconds
 
Bash:
cbsd jset interface=tun1 jname=XXX
or `cbsd jconfig' -> 'jail' -> 'interface'.

By default, `interface=auto`, which means that the interface will be chosen based on 'route -n get <IP>` where IP is jail IP ( ip4_addr ).
If it's `vnet` jail, you can change interface via 'cbsd jconfig' -> 'jailnic' -> 'nic1' -> 'nic_parent'.
 
BTW, 'tun' is not the correct interface for the container/IP. You can create 'bridge' interface for jails, e.g. via /etc/rc.conf:
Code:
cloned_interface="bridge100"
ifconfig_bridge100="10.0.100.1/24 up"

and set:
Code:
cbsd jset interface=auto ip4_addr="10.0.100.2" jname=jailc1

or
Code:
cbsd jset interface=bridge100 jname=jailc1

( don't forget to change 'nodeippool' settings in `cbsd initenv-tui` to '10.0.100.0/24' for auto-IP )
 
Back
Top