new set of multi-IPv4/v6/noIP jail patches

Christopher Thunes c2thunes at brewtab.com
Mon Jul 7 17:39:27 UTC 2008


Hi Bjoern,
   I apologize for not including this information originally. This is 
the 7.0-RELEASE patch but I applied it against a kernel with the memory 
limits patch already in place. I had to manually merge most of 
kern_jail.c by hand.

I tried again to start a jail and found that I could run the following 
and it works as you demonstrated.

[root at virt] ~ # jail -n test1 /usr/jail/4001/ test1 
208.86.224.219,10.11.40.2 /sbin/ifconfig -a
priv0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
         options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
         ether 00:30:48:c2:89:2a
         inet 10.11.40.2 netmask 0xffffffff broadcast 10.11.40.2
         media: Ethernet autoselect (1000baseTX <full-duplex>)
         status: active
pub0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
         options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
         ether 00:30:48:c2:89:2b
         inet 208.86.224.219 netmask 0xffffffff broadcast 208.86.224.219
         media: Ethernet autoselect (100baseTX <half-duplex>)
         status: active

That is one IP each from two interfaces. I tried with two from the 
public interface and one from the private interface and then it failed 
to assign the address on the private interface. All necessary aliases 
have been created.

[root at virt] ~ # jail -n test1 /usr/jail/4001/ test1 
208.86.224.219,208.86.224.220,10.11.40.2 /sbin/ifconfig -a
priv0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
         options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
         ether 00:30:48:c2:89:2a
         media: Ethernet autoselect (1000baseTX <full-duplex>)
         status: active
pub0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
         options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
         ether 00:30:48:c2:89:2b
         inet 208.86.224.219 netmask 0xffffffff broadcast 208.86.224.219
         inet 208.86.224.220 netmask 0xffffffff broadcast 208.86.224.220
         media: Ethernet autoselect (100baseTX <half-duplex>)
         status: active

Other combinations give other strange results. Assigning two address 
from each interface resulted in two being assigned to the private 
interface but only one to the public interface. I'm not sure what's 
going on or if I'm just doing something stupid but any insight would be 
appreciated.

Much Thanks,
Chris

Bjoern A. Zeeb wrote:
> On Mon, 7 Jul 2008, Christopher Thunes wrote:
> 
> Hi,
> 
>>  Should these patches allow multiples IPs which are on multiple 
>> interfaces? I've been playing around with this and was unable to 
>> assign IP address from more than one interface correctly. jls will 
>> show all IPs correctly but from within the jail only IPs from one 
>> interface show up in ifconfig and are able to be binded to.
> 
> Did the patch apply cleanly? Which one? Which release?
> 
> dopt# ifconfig lo1 create
> dopt# ifconfig lo1 inet 192.0.2.100/32
> dopt# ifconfig lo2 create
> dopt# ifconfig lo2 inet 192.0.2.200/32
> dopt# jail -n multiif /local/jails/j1 dopt 192.0.2.100,192.0.2.200 
> /sbin/ifconfig -a
> fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=b<RXCSUM,TXCSUM,VLAN_MTU>
>         ether 00:e0:81:31:db:62
>         media: Ethernet autoselect (none)
>         status: no carrier
> bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
>         ether 00:e0:81:31:db:8c
>         media: Ethernet autoselect (1000baseTX <full-duplex>)
>         status: active
> bge1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
>         ether 00:e0:81:31:db:8d
>         media: Ethernet autoselect (none)
>         status: no carrier
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         inet 192.0.2.100 netmask 0xffffffff
> lo2: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         inet 192.0.2.200 netmask 0xffffffff
> dopt#
> 
> Works here.
> 
> 
> Greetings
> Bjoern
> 


More information about the freebsd-jail mailing list