четвъртък, 19 ноември 2015 г.

Solaris Bridge/Switch

The idea is that we need to use 4 x 10Gbe interfaces on a Solaris box for switch for 4 hypervisors and at the same time have connection from the hypervisors to the storage (the same 4 x 10 Gbe box)

root@mrsas:~# dladm create-bridge -l ixgbe0 -l ixgbe1  -l ixgbe2 -l ixgbe3 storage
root@mrsas:~# dladm show-bridge
BRIDGE      PROTECT ADDRESS            PRIORITY DESROOT
storage     stp     32768/0:25:90:f9:6b:2e 32768 32768/0:25:90:f9:6b:2e
root@mrsas:~# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
igb0        phys      1500   up       --         --
igb1        phys      1500   unknown  --         --
ixgbe0      phys      1500   up       storage    --
ixgbe1      phys      1500   up       storage    --
ixgbe2      phys      1500   up       storage    --
ixgbe3      phys      1500   up       storage    --
storage0    bridge    1500   up       --         ixgbe0 ixgbe1 ixgbe2 ixgbe3
root@mrsas:~#



>> I tried to setup a etherstub and a vnic. I then tried to setup a bridge between that and the physical interface, as follows:
>>
>> LINK        CLASS     MTU    STATE    BRIDGE     OVER
>> igb0        phys      1500   up       zbridge    --
>> igb1        phys      1500   up       --         --
>> workswitch0 etherstub 1500   unknown  zbridge    --
>> work0       vnic      1500   unknown  --         workswitch0
>> zbridge0    bridge    1500   up       --         workswitch0 igb0
>
> Perhaps a dumb question here, but why would you do that?  The whole
> point of an etherstub object is that it's not connected to the outside
> world.  And if you want a connection to the outside world, why not just
> create the vnic on top of a real link?
>
> That aside, I think you might get further using 'dladm create-simnet'
> rather than an etherstub.  A simnet is a simulated Ethernet interface.
>
> As for the "STATE unknown" bit, I believe that's because etherstubs
> don't have physical links and thus don't have physical link status.
> It's probably harmless.

root@mrsas:~# dladm create-simnet nic0
root@mrsas:~# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
igb0        phys      1500   up       --         --
igb1        phys      1500   unknown  --         --
ixgbe0      phys      1500   up       storage    --
ixgbe1      phys      1500   up       storage    --
ixgbe2      phys      1500   up       storage    --
ixgbe3      phys      1500   up       storage    --
storage0    bridge    1500   up       --         ixgbe0 ixgbe1 ixgbe2 ixgbe3
nic0        simnet    1500   up       --         --

root@mrsas:~# ipadm create-if nic0
root@mrsas:~# ipadm create-addr -T static -a 172.16.20.1/24 nic0/v4
root@mrsas:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---
igb0       ok       bm--------46 -46
ixgbe1     down     bm--------46 -46
ixgbe2     ok       bm--------46 -46
ixgbe3     down     bm--------46 -46
nic0       ok       bm--------46 -46

root@mrsas:~# dladm add-bridge -l nic0 storage
root@mrsas:~# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
igb0        phys      1500   up       --         --
igb1        phys      1500   unknown  --         --
ixgbe0      phys      1500   up       storage    --
ixgbe1      phys      1500   up       storage    --
ixgbe2      phys      1500   up       storage    --
ixgbe3      phys      1500   up       storage    --
storage0    bridge    1500   up       --         ixgbe0 ixgbe1 ixgbe2 ixgbe3 nic0
nic0        simnet    1500   up       --         --

Links:
http://www.c0t0d0s0.org/archives/7424-Simulating-the-cloud-a-practical-example..html