Difference between revisions of "Virtual nics omnios"

From Asenjo
Jump to: navigation, search
m
 
Line 9: Line 9:
 
1st, get the real nic on the system
 
1st, get the real nic on the system
  
<code><pre>
+
<pre>
 
# dladm show-phys
 
# dladm show-phys
 
LINK        MEDIA                STATE      SPEED  DUPLEX    DEVICE
 
LINK        MEDIA                STATE      SPEED  DUPLEX    DEVICE
 
bge0        Ethernet            up        1000  full      bge0
 
bge0        Ethernet            up        1000  full      bge0
</pre></code>
+
</pre>
  
 
then create a vnic on top of that
 
then create a vnic on top of that
<code><pre>
+
<pre>
 
# dladm create-vnic -l bge0 vnic1
 
# dladm create-vnic -l bge0 vnic1
</pre></code>
+
</pre>
  
 
check it's there:
 
check it's there:
<code><pre>
+
<pre>
 
# dladm show-vnic
 
# dladm show-vnic
 
LINK        OVER        SPEED  MACADDRESS        MACADDRTYPE        VID
 
LINK        OVER        SPEED  MACADDRESS        MACADDRTYPE        VID
 
vnic1        bge0        1000  2:8:20:ae:f6:c0  random              0
 
vnic1        bge0        1000  2:8:20:ae:f6:c0  random              0
</pre></code>
+
</pre>
  
 
create a zone and assign it the new vnic:
 
create a zone and assign it the new vnic:
  
<code><pre>
+
<pre>
 
global # zonecfg -z sapacc
 
global # zonecfg -z sapacc
 
sapacc: No such zone configured
 
sapacc: No such zone configured
Line 43: Line 43:
 
zonecfg:sapacc> commit
 
zonecfg:sapacc> commit
 
zonecfg:sapacc> exit
 
zonecfg:sapacc> exit
</pre></code>
+
</pre>
  
 
install the zone, boot it, and then log in and configure the vnic
 
install the zone, boot it, and then log in and configure the vnic
Line 49: Line 49:
  
 
obviously we have no phys link, so now dladm show-phys, the rest is the same
 
obviously we have no phys link, so now dladm show-phys, the rest is the same
<code><pre>
+
<pre>
 
# dladm show-link
 
# dladm show-link
 
LINK        CLASS    MTU    STATE    BRIDGE    OVER
 
LINK        CLASS    MTU    STATE    BRIDGE    OVER
 
vnic1      vnic      1500  up      --        ?
 
vnic1      vnic      1500  up      --        ?
</pre></code>
+
</pre>
  
 
The easiest way is to have a dhcp server in your network, then it is just a question of touching /etc/dhcp.interface_name (vnic1, for instance) and rebooting and everything will just work.
 
The easiest way is to have a dhcp server in your network, then it is just a question of touching /etc/dhcp.interface_name (vnic1, for instance) and rebooting and everything will just work.

Latest revision as of 17:12, 15 March 2016


using crossbow (nice when you only have 1 phys nic, so from inside the non-global zones you can up/down/configure it)

https://blogs.oracle.com/mandalika/entry/controlling_virtual_network_interfaces_in

http://en.wikipedia.org/wiki/OpenSolaris_Network_Virtualization_and_Resource_Control

1st, get the real nic on the system

# dladm show-phys
LINK         MEDIA                STATE      SPEED  DUPLEX    DEVICE
bge0         Ethernet             up         1000   full      bge0

then create a vnic on top of that

# dladm create-vnic -l bge0 vnic1

check it's there:

# dladm show-vnic
LINK         OVER         SPEED  MACADDRESS        MACADDRTYPE         VID
vnic1        bge0         1000   2:8:20:ae:f6:c0   random              0

create a zone and assign it the new vnic:

global # zonecfg -z sapacc
sapacc: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:sapacc> create
zonecfg:sapacc> set zonepath=/export/zones/sapacc
zonecfg:sapacc> set autoboot=false
zonecfg:sapacc> set ip-type=exclusive
zonecfg:sapacc> add net
zonecfg:sapacc:net> set physical=vnic1
zonecfg:sapacc:net> end
zonecfg:sapacc> verify
zonecfg:sapacc> commit
zonecfg:sapacc> exit

install the zone, boot it, and then log in and configure the vnic using the instructions on http://omnios.omniti.com/wiki.php/GeneralAdministration

obviously we have no phys link, so now dladm show-phys, the rest is the same

# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
vnic1       vnic      1500   up       --         ?

The easiest way is to have a dhcp server in your network, then it is just a question of touching /etc/dhcp.interface_name (vnic1, for instance) and rebooting and everything will just work.