Dladm: Virtual Networks Wit
Total Page:16
File Type:pdf, Size:1020Kb
dladm: Virtual networks with Sun xVM - My South http://southbrain.com/south/2009/12/dladm-virtual-networks-sun-xvm.html My South dladm: Virtual networks with Sun xVM Search By Pascal Gienger on December 10, 2009 6:57 PM | Permalink | Comments (0) | TrackBacks (0) Solaris has a nifty utility named "dladm" which creates "dynamic" links. Mon midi - blog français It can be used to: work with virtual network interfaces work with wireless interfaces (WiFi) work with virtual switches (named etherstubs and bridges) About me Pages For our Xen-based xVM environment, a virtual switch to connect DomU's to an internal Pascal Gienger, Konstanz, network is a common configuration. This Germany virtual switch may even have an interface to articles the Dom0 system - the path to the outside LSI ProFibre 4000R: anno world. 2002. SATA-RAID and ZFS: Infortrend/ADVUNI OXYGENRAID: top or flop? Sun StorageTek StorEdge 6140 FC/SATA array software Mandelbrot set as Java Applet vhci_stat tutorials Creating and manipulating zpools (zfs) Fiberchannel Solaris Part 1: Introduction Fiberchannel Solaris Part 2: Configuring SAN and TCP/IP Fiberchannel Solaris Part 3: SAN Diagnostics Installing Redhat Enterprise Server 5 in VMWare with PVSCSI (paravirtual SCSI) Installing Redhat Enterprise Server 5 under Sun xVM/Xen Installing SLES 11 under Xen (Sun xVM) Using zfs (basics) uncommented OpenSolaris snv_121 Xen Look at the configuration example on the picture above (click to enlarge it). boot (Sun xVM 3.4.2) This configuration would appear like this on our Solaris host: Redhat ES 5.4 Xen Boot (Sun xVM 3.4.2) pascal@teroknor:~# dladm show-link LINK CLASS MTU STATE BRIDGE OVER SLES 11 Xen boot (Sun xVM nge0 phys 1500 up -- -- 3.4.2) nge1 phys 1500 up -- -- virtualization e1000g0 phys 1500 up mybridge -- 1: Why virtualization? e1000g1 phys 1500 up mybridge -- xenswitch1 etherstub 1500 unknown -- -- 2: Userspace-based bridge0 etherstub 1500 up mybridge -- virtualization (the easy loveit0 vnic 1500 up -- xenswitch1 way) xvm17 vnic 1500 up -- xenswitch1 3: Xen: Hypervisor-based xvm19 vnic 1500 up -- bridge0 virtualization xvm14 vnic 1500 up -- nge0 4: ESX: Hypervisor-based First some Solaris definitions: virtualization 5: Solaris Zones: A sharing A physical interface (phys) is an interface controlled by a hardware driver. These interfaces are physically approach present. Examples include an ethernet interface or a fiber channel ip interface. 6: Hybrid methods: KVM A virtual interface (vnic) is a network interface only known by the kernel which can be used in software like a real interface. You may use them in Dom0 or in any DomU you want (the latter by assignment via xm or virsh). Categories 1 von 3 13.12.2009 12:56 dladm: Virtual networks with Sun xVM - My South http://southbrain.com/south/2009/12/dladm-virtual-networks-sun-xvm.html An etherstub is like an unmanaged dumb ethernet switch, traffic originating from connecting links to the Asterisk VoIP (6) etherstub is directed to the right direction (layer 2) to other interfaces "connected" to this etherstub. A virtual BSOD (1) interface MUST be connected to an etherstub OR a physical hardware interface otherwise it will not work - Cisco (2) you may even not define it, the dladm command will abort with an error. Cyrus IMAP (5) A bridge is a 802.1d instance making a real bridge instance out of an etherstub. Physical interfaces can be Horde framework (1) "connected" directly to a bridge while virtual ones must be connected to an etherstub which itself is member of the bridge. Java (1) A bridge talks the spanning tree protocol - Just like a hardware switch would do. Linux (1) Misc (17) The first example on the graphic is easy: A virtual interface is directly connected to a physical one. The kernel acts Perl (6) like an unmanaged switch between these two interfaces. You may "connect" as many virtual interfaces as you want Postfix (7) to a real interface. Solaris (54) Travel (11) Our vnic "xvm14" was easy to accomplish: Unforgotten (7) # dladm create-vnic -l nge0 xvm14 Virtualization (23) Sun xVM (18) And voilà, our xvm14 network interface is ready. In fact, this is exactly what the xen daemon does when starting a VirtualBox (3) virtual machine - it hooks dynamically virtual interfaces to the appopriate "bridges" ( be careful: In Xen vmware (5) terminology a "bridge" is not a "bridge" in the Solaris terms: For Xen it just means a virtual switch - so remember: a Xen bridge is a Solaris etherstub ). Monthly Archives The second example has been configured like this: December 2009 (4) November 2009 (7) # dladm create-etherstub xenswitch1 # dladm set-linkprop -p mtu=1500 xenswitch1 October 2009 (7) # dladm create-vnic -l xenswitch1 loveit0 September 2009 (13) August 2009 (9) The vnic xvm_17 was created automatically by the xen daemon. June 2009 (5) The "dladm set-linkprop -p mtu=1500" is IMPORTANT because etherstubs are created with a default MTU of 9000 bytes - OpenSolaris just crashes badly when you try to use a vnic with this MTU as a Xen interface... May 2009 (1) April 2009 (4) In the Dom0 Solaris the new interface "loveit0" can be used Just like any other one: March 2009 (3) February 2009 (2) # ifconfig loveit0 plumb January 2009 (1) # ifconfig loveit0 192.168.200.1 netmask 0xffffff00 broadcast 255.255.255.0 up # ifconfig loveit0 December 2008 (1) loveit0: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 4 November 2008 (3) inet 192.168.200.1 netmask ffffff00 broadcast 192.168.200.255 ether 2:8:20:8a:35:b5 October 2008 (6) September 2008 (2) This interface can be used to route/forward, including NAT (refer to routeadm and ipnat/ipf). August 2008 (6) July 2008 (6) The third example includes a (802.1d stp) bridge: June 2008 (4) # dladm create-bridge mybridge May 2008 (8) # dladm create-etherstub bridge0 April 2008 (7) # dladm set-linkprop -p mtu=1500 bridge0 March 2008 (6) # dladm add-bridge -l bridge0 mybridge # dladm add-bridge -l e1000g0 mybridge February 2008 (11) # dladm add-bridge -l e1000g1 mybridge Recent Entries If you want to install a DomU using "virt-install" Just use the "--bridge" (Xen-bridge -> etherstub) commandline option http://127.0.0.1:8795/?id= to select the right etherstub to connect to. dladm: Virtual networks with Sun xVM Example: Sun MPxIO: multipathed network connections # virt-install --hvm --cdrom=/rpool/ISO/windows2008r2.iso --ram 2048 --disk path=.... 141445-09/141444-09 Solaris --bridge xenswitch1 --vnc --os-type windows --os-variant windows --name "testdomu" 10: zfs version 15, ::memstat Sun xVM 3.4.2 available, This installation will connect a Xen interface to the "xenswitch1" etherstub. If this Windows DomU has the IP address dom0_min_mem 192.168.200.2/24 it will be able to talk to the Dom0 by using 192.168.200.1 as a target. To connect this Windows host Windows 2008 R2 on Sun xVM to the outer network you will have to turn IP forwarding on the OpenSolaris Dom0 and - depending on your network 3.4.2 / Xen configuration - you'll have to turn on NAT (via /etc/ipf/ipnat.conf and svcadm enable ipfilter). Update: Xen Drivers for Windows 2003 and XP 32bit If you omit the "--bridge" parameter virt-install will just define a vnic connected directly to the first configured hardware interface in your machine - if that's your network link to your LAN the virtual machine will be part of New ZFS feature: deduplication - new in snv_128 that LAN. snv_128 / ZFS version 22 dedup not mounting/kernel hang Categories: Solaris , Sun xVM , Virtualization Qualatex Balloons and Gallo Tags: dladm , OpenSolaris , Solaris , xen , xVM Wine... 0 TrackBacks December 2009 Listed below are links to blogs that reference this entry: dladm: Virtual networks with Sun xVM . SunMonTueWedThuFriSat 1 2 3 4 5 TrackBack URL for this entry: http://southbrain.com/mt/mt-tb.cgi/140 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Leave a comment 27 28 29 30 31 Sign in to comment on this entry, or comment anonymously. About This blog is owned by: 2 von 3 13.12.2009 12:56 dladm: Virtual networks with Sun xVM - My South http://southbrain.com/south/2009/12/dladm-virtual-networks-sun-xvm.html Pascal Gienger Kanzleistr. 14 78462 Konstanz Powered by Movable Type Open Source Phone +49 7531 584298 Fax +49 7531 584298-9 Phone USA 1-678-791-4182 YouTube Channel: pascalgienger 3 von 3 13.12.2009 12:56.