simnet
I just write about simnet. What are simnets? I just want to point you to the PSARC case for indepth information. It's available on opensolaris.org in the caselog. But in short: Simnets are simulated networks. It's a mechanism to test networking protocols. And in this example we will use it exactly for this purpose. Testing networking.Okay, let's assume you are admin of FUBAR Inc. You want to recreate your network in a box. You have offices in Hamburg, London, Singapore, New York and San Francisco. In each office you have a multi-legged router, connecting to a switch for the internal network with servers an clients, the other interfaces of the switch are connecting to the other routers. As an image says more than 1000 words i will just summarize the network with this figure.
Configuring it
Of course the and the servers will be zones. However we have to recreate the network topology as well. And that's the point where we use the the simnet non-feature.
We need a the switches in our offices first. Those are really easy to configure
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-bridge london
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-bridge hamburg
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-bridge singapore
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-bridge newyork
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-bridge sanfrancisco
Now i need some switchports. At first i create some switch ports in order to connect the switch to the router.
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonsw1_255
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sanfranciscosw1_255
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet newyorksw1_255
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgsw1_255
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet singaporesw1_255
Now i create some additional switchports to connect servers.
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonsw1_1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonsw1_2
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgsw1_1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet singaporesw1_1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet newyorksw1_1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sanfranciscosw1_1
Ports meant for the bridge are nice, however they should be connected with the bridge.
root@cloudinabox:/opt/cloudsimulation/zones# dladm add-bridge -l londonsw1_1 -l londonsw1_2 -l londonsw1_255 london
root@cloudinabox:/opt/cloudsimulation/zones# dladm add-bridge -l hamburgsw1_1 -l hamburgsw1_255 hamburg
root@cloudinabox:/opt/cloudsimulation/zones# dladm add-bridge -l singaporesw1_1 -l singaporesw1_255 singapore
root@cloudinabox:/opt/cloudsimulation/zones# dladm add-bridge -l sanfranciscosw1_1 -l sanfranciscosw1_255 sanfrancisco
root@cloudinabox:/opt/cloudsimulation/zones# dladm add-bridge -l newyorksw1_1 -l newyorksw1_255 newyork
Let's now create all the interfaces we need for the routers.
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonrouter1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgrouter1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgrouter2
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgrouter3
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet newyorkrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet newyorkrouter1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sinrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sinrouter1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sinrouter2
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sforouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sforouter1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sforouter2
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sforouter3
>And of course we need interfaces for all the servers
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonsrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet londonsrv2
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgsrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet singaporesrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet sanfranciscosrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet newyorksrv1
Now we have to create logical cables … lots of them. At first the routers with their switches.
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p londonsw1_255 londonrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p hamburgsw1_255 hamburgrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p singaporesw1_255 sinrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p newyorksw1_255 newyorkrouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p sanfranciscosw1_255 sforouter0
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p hamburgrouter1 londonrouter1
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p sforouter1 hamburgrouter2
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p sinrouter1 hamburgrouter3
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p sforouter3 sinrouter2
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p newyorkrouter1 sforouter2
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p hamburgsw1_1 hamburgsrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p singaporesw1_1 singaporesrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p newyorksw1_1 newyorksrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p londonsw1_1 londonsrv1
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p londonsw1_2 londonsrv2
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p sanfranciscosw1_1 sanfranciscosrv1
Uff … on the networking side this is all.
The active configuration should look something like that ...
root@cloudinabox:/home/jmoekamp# dladm show-link
LINK CLASS MTU STATE OVER
net1 phys 1500 unknown --
net2 phys 1500 up --
net0 phys 1500 unknown --
london0 bridge 1500 up londonsw1_1 londonsw1_2 londonsw1_255
hamburg0 bridge 1500 up hamburgsw1_1 hamburgsw1_255
singapore0 bridge 1500 up singaporesw1_1 singaporesw1_255
newyork0 bridge 1500 up newyorksw1_1 newyorksw1_255
sanfrancisco0 bridge 1500 up sanfranciscosw1_1 sanfranciscosw1_255
londonsw1_255 simnet 1500 up londonrouter0
sanfranciscosw1_255 simnet 1500 up sforouter0
newyorksw1_255 simnet 1500 up newyorkrouter0
hamburgsw1_255 simnet 1500 up hamburgrouter0
singaporesw1_255 simnet 1500 up sinrouter0
londonsw1_1 simnet 1500 up londonsrv1
londonsw1_2 simnet 1500 up londonsrv2
hamburgsw1_1 simnet 1500 up hamburgsrv1
singaporesw1_1 simnet 1500 up singaporesrv1
newyorksw1_1 simnet 1500 up newyorksrv1
sanfranciscosw1_1 simnet 1500 up sanfranciscosrv1
londonrouter0 simnet 1500 up londonsw1_255
londonrouter1 simnet 1500 up hamburgrouter1
hamburgrouter0 simnet 1500 up hamburgsw1_255
hamburgrouter1 simnet 1500 up londonrouter1
hamburgrouter2 simnet 1500 up sforouter1
hamburgrouter3 simnet 1500 up sinrouter1
newyorkrouter0 simnet 1500 up newyorksw1_255
newyorkrouter1 simnet 1500 up sforouter2
sinrouter0 simnet 1500 up singaporesw1_255
sinrouter1 simnet 1500 up hamburgrouter3
sinrouter2 simnet 1500 up sforouter3
sforouter0 simnet 1500 up sanfranciscosw1_255
sforouter1 simnet 1500 up hamburgrouter2
sforouter2 simnet 1500 up newyorkrouter1
sforouter3 simnet 1500 up sinrouter2
londonsrv1 simnet 1500 up londonsw1_1
londonsrv2 simnet 1500 up londonsw1_2
hamburgsrv1 simnet 1500 up hamburgsw1_1
singaporesrv1 simnet 1500 up singaporesw1_1
sanfranciscosrv1 simnet 1500 up sanfranciscosw1_1
newyorksrv1 simnet 1500 up newyorksw1_1
Zone Creation
Okay, now we have to create the zones.
mkdir -p /opt/cloudsimulation/zones
zfs create rpool/zones
zfs set mountpoint=/zones rpool/zones
We create a lot of controlfiles first. I created the /opt/cloudsimulation/zones directory to hold them
/opt/cloudsimulation/zones/templateserver:
create -b
set zonepath=/zones/templateserver
set brand=solaris
set autoboot=false
set ip-type=exclusive
/opt/cloudsimulation/zones/londonrouter:
create -b
set zonepath=/zones/londonrouter
set brand=solaris
set autoboot=false
set ip-type=exclusive
add net
set configure-allowed-address=true
set physical=londonrouter0
end
add net
set configure-allowed-address=true
set physical=londonrouter1
end
/opt/cloudsimulation/zones/hamburgrouter
create -b
set zonepath=/zones/hamburgrouter
set brand=solaris
set autoboot=false
set ip-type=exclusive
add net
set configure-allowed-address=true
set physical=hamburgrouter0
end
add net
set configure-allowed-address=true
set physical=hamburgrouter1
end
add net
set configure-allowed-address=true
set physical=hamburgrouter2
end
add net
set configure-allowed-address=true
set physical=hamburgrouter3
end
/opt/cloudsimulation/zones/singaporerouter:
create -b
set zonepath=/zones/singaporerouter
set brand=solaris
set autoboot=false
set ip-type=exclusive
add net
set configure-allowed-address=true
set physical=sinrouter0
end
add net
set configure-allowed-address=true
set physical=sinrouter1
end
add net
set configure-allowed-address=true
set physical=sinrouter2
end
/opt/cloudsimulation/zones/sanfranciscorouter:
create -b
set zonepath=/zones/sanfranciscorouter
set brand=solaris
set autoboot=false
set ip-type=exclusive
add net
set configure-allowed-address=true
set physical=sforouter0
end
add net
set configure-allowed-address=true
set physical=sforouter1
end
add net
set configure-allowed-address=true
set physical=sforouter2
end
add net
set configure-allowed-address=true
set physical=sforouter3
end
/opt/cloudsimulation/zones/newyorkrouter:
create -b
set zonepath=/zones/newyorkrouter
set brand=solaris
set autoboot=false
set ip-type=exclusive
add net
set configure-allowed-address=true
set physical=newyorkrouter0
end
add net
set configure-allowed-address=true
set physical=newyorkrouter1
end
Whois is wondering about the sfo and sin IATA shorthands that i've used instead of the long names in other "cities". Quagga doesn't seem to like interface names longer than 16 characters.
Okay. Now we have to create all the zones:
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z templateserver -f /opt/cloudsimulation/zones/templateserver
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z templaterouter -f /opt/cloudsimulation/zones/templaterouter
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z londonrouter -f /opt/cloudsimulation/zones/londonrouter
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z singaporerouter -f /opt/cloudsimulation/zones/singaporerouter
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z hamburgrouter -f /opt/cloudsimulation/zones/hamburgrouter
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z sanfranciscorouter -f /opt/cloudsimulation/zones/sanfranciscorouter
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z newyorkrouter -f /opt/cloudsimulation/zones/newyorkrouter
Okay, at first we install the template zone.
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z templateserver install
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T184237Z.templateserver.install
Image: Preparing at /zones/templateserver/root
Install Log: /system/volatile/install.4469/install_log
AI Manifest: /tmp/manifest.xml.oBayTi
SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
Zonename: templateserver
Installation: Starting ...
Creating IPS image
Installing packages from:
solaris
origin: http://pkg.oracle.com/solaris/release/
DOWNLOAD PKGS FILES XFER (MB)
Completed 167/167 32062/32062 175.8/175.8
PHASE ACTIONS
Install Phase 44313/44313
PHASE ITEMS
Package State Update Phase 167/167
Image State Update Phase 2/2
Installation: Succeeded
Note: Man pages can be obtained by installing pkg:/system/manual
done.
Done: Installation completed in 1423,641 seconds.
Next Steps: Boot the zone, then log into the zone console (zlogin -C)
to complete the configuration process.
Log saved in non-global zone as /zones/templateserver/root/var/log/zones/zoneadm.20111217T184237Z.templateserver.install
We never boot this one, it's just to ease the next steps.
However to circumvent the need to go through each sysconfig dialog in each router we will use a simple trick. You can create a xml file containing the necessary data and pass it to the cloning of the zone.
root@cloudinabox:/opt/cloudsimulation/zones# sysconfig create-profile -o template.xml
After leaving the last screen, you should yield a file with content similar to this:
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
<service version="1" type="service" name="system/config-user">
<instance enabled="true" name="default">
<property_group type="application" name="root_account">
<propval type="astring" name="login" value="root"/>
<propval type="astring" name="password" value="$5$35worB11$/EeCnO5t2zOHhasRQeWeVyWuGLFFUFLQGmOhKPX82m2"/>
<propval type="astring" name="type" value="role"/>
</property_group>
<property_group type="application" name="user_account">
<propval type="astring" name="login" value="radmin"/>
<propval type="astring" name="password" value="$5$XztZ799F$GVL48echivvJcPl.BRcVvnn3/M8Z7L6LhmyVPP04J/2"/>
<propval type="astring" name="type" value="normal"/>
<propval type="astring" name="description" value="routeradm"/>
<propval type="count" name="gid" value="10"/>
<propval type="astring" name="shell" value="/usr/bin/bash"/>
<propval type="astring" name="roles" value="root"/>
<propval type="astring" name="profiles" value="System Administrator"/>
<propval type="astring" name="sudoers" value="ALL=(ALL) ALL"/>
</property_group>
</instance>
</service>
<service version="1" type="service" name="system/timezone">
<instance enabled="true" name="default">
<property_group type="application" name="timezone">
<propval type="astring" name="localtime" value="UTC"/>
</property_group>
</instance>
</service>
<service version="1" type="service" name="system/environment">
<instance enabled="true" name="init">
<property_group type="application" name="environment">
<propval type="astring" name="LANG" value="C"/>
</property_group>
</instance>
</service>
<service version="1" type="service" name="system/identity">
<instance enabled="true" name="node">
<property_group type="application" name="config">
<propval type="astring" name="nodename" value="jamphfhn"/>
</property_group>
</instance>
</service>
<service version="1" type="service" name="system/keymap">
<instance enabled="true" name="default">
<property_group type="system" name="keymap">
<propval type="astring" name="layout" value="German"/>
</property_group>
</instance>
</service>
<service version="1" type="service" name="system/console-login">
<instance enabled="true" name="default">
<property_group type="application" name="ttymon">
<propval type="astring" name="terminal_type" value="sun-color"/>
</property_group>
</instance>
</service>
<service version="1" type="service" name="network/physical">
<instance enabled="true" name="default">
<property_group type="application" name="netcfg"/>
</instance>
</service>
</service_bundle>
Before you ask, the password for radmin and root is n0mn0mn0m. And the jamphfhn just stands for "just a meaningless placeholder for hostname".
Okay, i will create another template zone. This is because a routing zone will have some special properties that a zone acting as a server doesn't need and i don't want such properties in the server zones.
At first i just take the template.xml script and substitute the hostname. I could simply do it via vi, but for a tutorial a simple shell line is more efficient.
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/templaterouter/ > templaterouter.xml
I use the newly created file as an input for the zone clone command.
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z templaterouter clone -c /opt/cloudsimulation/zones/templaterouter.xml templateserver
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T193101Z.templaterouter.clone
Log saved in non-global zone as /zones/templaterouter/root/var/log/zones/zoneadm.20111217T193101Z.templaterouter.clone
As the system just creates a zfs clone the command should return after a small period of time. Now we can log into the console of the zone with zlogin.
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z templaterouter boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C templaterouter
[Connected to zone 'templaterouter' console]
Hostname: unknown
Hostname: templaterouter
templaterouter console login: radmin
Password:
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@templaterouter:~$
radmin@templaterouter:~$ sudo bash
Password:
Dec 17 19:36:33 templaterouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
root@templaterouter:/home/radmin#
I wrote earlier, that the template for the router contains some additional stuff ….
root@templaterouter:/home/radmin# pkg install pkg://solaris/network/telnet
Packages to install: 1
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 8/8 0.1/0.1
PHASE ACTIONS
Install Phase 22/22
PHASE ITEMS
Package State Update Phase 1/1
Image State Update Phase 2/2
root@templaterouter:/home/radmin# pkg install quagga
Packages to install: 1
Create boot environment: No
Create backup boot environment: No
Services to change: 3
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 89/89 2.7/2.7
PHASE ACTIONS
Install Phase 132/132
PHASE ITEMS
Package State Update Phase 1/1
Image State Update Phase 2/2
Loading smf(5) service descriptions: 2/2
routeadm -e ipv4-forwarding
routeadm -e ipv4-routing
routeadm -m zebra:quagga vty_port="2602"
routeadm -m ospf:quagga vty_port="2601"
routeadm -m zebra:quagga vty_address="127.0.0.1"
routeadm -m ospf:quagga vty_address="127.0.0.1"
routeadm -s routing-svcs=ospf:quagga -e ipv4-routing
routeadm -u
root@cloudinabox:/home/jmoekamp# zoneadm -z templaterouter halt
/opt/cloudsimulation/zones/zebra.london.conf
hostname londonrouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/zebra.log
line vty
/opt/cloudsimulation/zones/ospfd.london.conf
hostname londonrouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/ospf.log
!
!
!
interface lo0
!
interface londonrouter0
!
interface londonrouter1
!
router ospf
redistribute connected
network 10.1.1.0/24 area 0.0.0.0
!
line vty
!
/opt/cloudsimulation/zones/zebra.hamburg.conf
hostname hamburgrouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/zebra.log
line vty
/opt/cloudsimulation/zones/ospfd.hamburg.conf
hostname hamburgrouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/ospf.log
!
!
!
interface lo0
!
interface hamburgrouter0
!
interface hamburgrouter1
!
interface hamburgrouter2
!
interface hamburgrouter3
!
router ospf
redistribute connected
network 10.1.1.0/24 area 0.0.0.0
network 10.1.2.0/24 area 0.0.0.0
network 10.1.3.0/24 area 0.0.0.0
!
line vty
!
/opt/cloudsimulation/zones/zebra.singapore.conf
!
! Zebra configuration saved from vty
! 2011/12/12 20:20:13
!
hostname sinrouter
password nomnomnom
enable password nomnomnom
log file /var/adm/quagga/zebra.log
!
interface lo0
!
line vty
!
/opt/cloudsimulation/zones/ospfd.singapore.conf
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/ospf.log
!
interface lo0
!
interface sinrouter0
!
interface sinrouter1
!
interface sinrouter2
!
router ospf
redistribute connected
network 10.1.2.0/24 area 0.0.0.0
network 10.1.4.0/24 area 0.0.0.0
!
line vty
!
/opt/cloudsimulation/zones/zebra.sanfrancisco.conf
hostname sforouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/zebra.log
line vty
/opt/cloudsimulation/zones/ospfd.sanfrancisco.conf
!
! Zebra configuration saved from vty
! 2011/12/11 04:30:44
!
hostname sforouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/ospf.log
!
!
!
interface lo0
!
interface sforouter0
!
interface sforouter1
!
interface sforouter2
!
interface sforouter3
!
router ospf
redistribute connected
network 10.1.5.0/24 area 0.0.0.0
network 10.1.4.0/24 area 0.0.0.0
network 10.1.3.0/24 area 0.0.0.0
!
line vty
!
/opt/cloudsimulation/zones/zebra.newyork.conf
hostname newyorkrouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/zebra.log
line vty
/opt/cloudsimulation/zones/ospfd.newyork.conf
!
! Zebra configuration saved from vty
! 2011/12/11 04:30:44
!
hostname newyorkrouter
password nomnomnom
enable password nonnomnom
log file /var/adm/quagga/ospf.log
!
!
!
interface lo0
!
interface newyorkrouter0
!
interface newyorkrouter1
!
router ospf
redistribute connected
network 10.1.5.0/24 area 0.0.0.0
!
line vty
!
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/londonrouter/ > londonrouter.xml
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z londonrouter clone -c /opt/cloudsimulation/zones/londonrouter.xml templaterouter
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T205338Z.londonrouter.clone
Log saved in non-global zone as /zones/londonrouter/root/var/log/zones/zoneadm.20111217T205338Z.londonrouter.clone
root@cloudinabox:/opt/cloudsimulation/zones# cp zebra.london.conf /zones/londonrouter/root/etc/quagga/zebra.conf
root@cloudinabox:/opt/cloudsimulation/zones# cp ospfd.london.conf /zones/londonrouter/root/etc/quagga/ospfd.conf
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z londonrouter boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C londonrouter
[Connected to zone 'londonrouter' console]
londonrouter console login: radmin
Password:
Last login: Sat Dec 17 19:35:39 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@londonrouter:~$ sudo bash
Password:
Dec 17 20:57:58 londonrouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
root@londonrouter:/home/radmin#
# ipadm create-ip londonrouter0
# ipadm create-ip londonrouter1
# ipadm create-addr -T static -a 10.0.10.254/24 londonrouter0/v4
# ipadm create-addr -T static -a 10.1.1.254/24 londonrouter1/v4
# svcadm restart zebra
# svcadm restart ospf
root@londonrouter:/home/radmin# dladm show-link
LINK CLASS MTU STATE OVER
londonrouter0 simnet 1500 up ?
londonrouter1 simnet 1500 up ?
root@londonrouter:/home/radmin# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
londonrouter0/v4 static ok 10.0.10.254/24
londonrouter1/v4 static ok 10.1.1.254/24
lo0/v6 static ok ::1/128
root@londonrouter:/home/radmin# telnet localhost 2601
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to londonrouter.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.8).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
londonrouter> show ip ospf interface
lo0 is up
ifindex 1, MTU 8232 bytes, BW 0 Kbit
OSPF not enabled on this interface
londonrouter0 is up
ifindex 3, MTU 1500 bytes, BW 0 Kbit
OSPF not enabled on this interface
londonrouter1 is up
ifindex 2, MTU 1500 bytes, BW 0 Kbit
Internet Address 10.1.1.254/24, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 10.1.1.254, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 10.1.1.254, Interface Address 10.1.1.254
No backup designated router on this network
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 2.263s
Neighbor Count is 0, Adjacent neighbor count is 0
londonrouter> exit
Connection to londonrouter closed by foreign host.
root@londonrouter:/home/radmin# telnet localhost 2602
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to londonrouter.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.8).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
londonrouter> show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
C>* 10.0.10.0/24 is directly connected, londonrouter0
O 10.1.1.0/24 [110/10] is directly connected, londonrouter1, 00:04:28
C>* 10.1.1.0/24 is directly connected, londonrouter1
C>* 127.0.0.0/8 is directly connected, lo0
londonrouter>exit
root@londonrouter:/home/radmin# ~.
[Connection to zone 'londonrouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/hamburgrouter/ > hamburgrouter.xml
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z hamburgrouter clone -c /opt/cloudsimulation/zones/hamburgrouter.xml templaterouter
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T212009Z.hamburgrouter.clone
Log saved in non-global zone as /zones/hamburgrouter/root/var/log/zones/zoneadm.20111217T212009Z.hamburgrouter.clone
root@cloudinabox:/opt/cloudsimulation/zones# cp ospfd.hamburg.conf /zones/hamburgrouter/root/etc/quagga/ospfd.conf
root@cloudinabox:/opt/cloudsimulation/zones# cp zebra.hamburg.conf /zones/hamburgrouter/root/etc/quagga/zebra.conf
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z hamburgrouter boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C hamburgrouter
[Connected to zone 'hamburgrouter' console]
Hostname: hamburgrouter
hamburgrouter console login: radmin
Password:
Last login: Sat Dec 17 19:35:39 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@hamburgrouter:~$ sudo bash
Password:
Dec 17 21:23:45 hamburgrouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
root@hamburgrouter:/home/radmin#
ipadm create-ip hamburgrouter0
ipadm create-ip hamburgrouter1
ipadm create-ip hamburgrouter2
ipadm create-ip hamburgrouter3
ipadm create-addr -T static -a 10.0.11.254/24 hamburgrouter0/v4
ipadm create-addr -T static -a 10.1.1.1/24 hamburgrouter1/v4
ipadm create-addr -T static -a 10.1.3.1/24 hamburgrouter2/v4
ipadm create-addr -T static -a 10.1.2.1/24 hamburgrouter3/v4
root@hamburgrouter:/home/radmin# svcadm restart ospf
root@hamburgrouter:/home/radmin# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
hamburgrouter0/v4 static ok 10.0.11.254/24
hamburgrouter1/v4 static ok 10.1.1.1/24
hamburgrouter2/v4 static ok 10.1.3.1/24
hamburgrouter3/v4 static ok 10.1.2.1/24
lo0/v6 static ok ::1/128
root@hamburgrouter:/home/radmin# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
10.0.10.0 10.1.1.254 UG 1 0
10.0.11.0 10.0.11.254 U 2 0 hamburgrouter0
10.1.1.0 10.1.1.1 U 3 9 hamburgrouter1
10.1.2.0 10.1.2.1 U 2 0 hamburgrouter3
10.1.3.0 10.1.3.1 U 2 0 hamburgrouter2
127.0.0.1 127.0.0.1 UH 2 0 lo0
Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------- -----
::1 ::1 UH 2 0 lo0
root@hamburgrouter:/home/radmin#
root@hamburgrouter:/home/radmin# telnet localhost 2602
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to hamburgrouter.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.8).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
hamburgrouter> show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
O>* 10.0.10.0/24 [110/20] via 10.1.1.254, hamburgrouter1, 00:01:04
C>* 10.0.11.0/24 is directly connected, hamburgrouter0
O 10.1.1.0/24 [110/10] is directly connected, hamburgrouter1, 00:01:09
C>* 10.1.1.0/24 is directly connected, hamburgrouter1
O 10.1.2.0/24 [110/10] is directly connected, hamburgrouter3, 00:01:09
C>* 10.1.2.0/24 is directly connected, hamburgrouter3
O 10.1.3.0/24 [110/10] is directly connected, hamburgrouter2, 00:01:09
C>* 10.1.3.0/24 is directly connected, hamburgrouter2
C>* 127.0.0.0/8 is directly connected, lo0
hamburgrouter> exit
Connection to hamburgrouter closed by foreign host.
root@hamburgrouter:/home/radmin#
root@hamburgrouter:/home/radmin# ~.
[Connection to zone 'hamburgrouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/singaporerouter/ > singaporerouter.xml
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z singaporerouter clone -c /opt/cloudsimulation/zones/singaporerouter.xml templaterouter
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T223455Z.singaporerouter.clone
Log saved in non-global zone as /zones/singaporerouter/root/var/log/zones/zoneadm.20111217T223455Z.singaporerouter.clone
root@cloudinabox:/opt/cloudsimulation/zones# cp ospfd.singapore.conf /zones/singaporerouter/root/etc/quagga/ospfd.conf
root@cloudinabox:/opt/cloudsimulation/zones# cp zebra.singapore.conf /zones/singaporerouter/root/etc/quagga/zebra.conf
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z singaporerouter boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C singaporerouter
[Connected to zone 'singaporerouter' console]
singaporerouter console login: radmin
Password:
Last login: Sat Dec 17 19:35:39 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@singaporerouter:~$ sudo bash
Password:
Dec 17 22:37:58 singaporerouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
ipadm create-ip sinrouter0
ipadm create-ip sinrouter1
ipadm create-ip sinrouter2
ipadm create-addr -T static -a 10.0.12.254/24 sinrouter0/v4
ipadm create-addr -T static -a 10.1.2.254/24 sinrouter1/v4
ipadm create-addr -T static -a 10.1.4.1/24 sinrouter2/v4
root@singaporerouter:/home/radmin# svcadm restart zebra
root@singaporerouter:/home/radmin# svcadm restart ospf
root@singaporerouter:/home/radmin# telnet localhost 2602
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to singaporerouter.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.8).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
sinrouter> show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
O>* 10.0.10.0/24 [110/20] via 10.1.2.1, sinrouter1, 00:00:34
O>* 10.0.11.0/24 [110/20] via 10.1.2.1, sinrouter1, 00:00:34
C>* 10.0.12.0/24 is directly connected, sinrouter0
O>* 10.1.1.0/24 [110/20] via 10.1.2.1, sinrouter1, 00:00:35
O 10.1.2.0/24 [110/10] is directly connected, sinrouter1, 00:00:44
C>* 10.1.2.0/24 is directly connected, sinrouter1
O>* 10.1.3.0/24 [110/20] via 10.1.2.1, sinrouter1, 00:00:35
O 10.1.4.0/24 [110/10] is directly connected, sinrouter2, 00:00:44
C>* 10.1.4.0/24 is directly connected, sinrouter2
C>* 127.0.0.0/8 is directly connected, lo0
sinrouter> exit
Connection to singaporerouter closed by foreign host.
root@singaporerouter:/home/radmin# ~.
[Connection to zone 'singaporerouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/sanfranciscorouter/ > sanfranciscorouter.xml
root@cloudinabox:/opt/cloudsimulation/zones# ls
hamburgrouter ospfd.sanfrancisco.conf templaterouter.xml
hamburgrouter.xml ospfd.singapore.conf templateserver
londonrouter sanfranciscorouter zebra.hamburg.conf
londonrouter.xml sanfranciscorouter.xml zebra.london.conf
newyorkrouter singaporerouter zebra.newyork.conf
ospfd.hamburg.conf singaporerouter.xml zebra.sanfrancisco.conf
ospfd.london.conf template.xml zebra.singapore.conf
ospfd.newyork.conf templaterouter
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z sanfranciscorouter clone -c /opt/cloudsimulation/zones/sanfranciscorouter.xml templaterouter
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T224355Z.sanfranciscorouter.clone
Log saved in non-global zone as /zones/sanfranciscorouter/root/var/log/zones/zoneadm.20111217T224355Z.sanfranciscorouter.clone
root@cloudinabox:/opt/cloudsimulation/zones# cp ospfd.sanfrancisco.conf /zones/sanfranciscorouter/root/etc/quagga/ospfd.conf
root@cloudinabox:/opt/cloudsimulation/zones# cp zebra.sanfrancisco.conf /zones/sanfranciscorouter/root/etc/quagga/zebra.conf
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z sanfranciscorouter boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C sanfranciscorouter
[Connected to zone 'sanfranciscorouter' console]
sanfranciscorouter console login: radmin
Password:
Last login: Sat Dec 17 19:35:39 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@sanfranciscorouter:~$ sudo bash
Password:
Dec 17 22:46:49 sanfranciscorouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
ipadm create-ip sforouter0
ipadm create-ip sforouter1
ipadm create-ip sforouter2
ipadm create-ip sforouter3
ipadm create-addr -T static -a 10.0.13.254/24 sforouter0/v4
ipadm create-addr -T static -a 10.1.3.254/24 sforouter1/v4
ipadm create-addr -T static -a 10.1.5.1/24 sforouter2/v4
ipadm create-addr -T static -a 10.1.4.254/24 sforouter3/v4
root@sanfranciscorouter:/home/radmin# telnet localhost 2602
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to sanfranciscorouter.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.8).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
sforouter> show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
O>* 10.0.10.0/24 [110/20] via 10.1.3.1, sforouter1, 00:00:25
O>* 10.0.11.0/24 [110/20] via 10.1.3.1, sforouter1, 00:00:25
O>* 10.0.12.0/24 [110/20] via 10.1.4.1, sforouter3, 00:00:25
C>* 10.0.13.0/24 is directly connected, sforouter0
O>* 10.1.1.0/24 [110/20] via 10.1.3.1, sforouter1, 00:00:26
O>* 10.1.2.0/24 [110/20] via 10.1.3.1, sforouter1, 00:00:26
* via 10.1.4.1, sforouter3, 00:00:26
O 10.1.3.0/24 [110/10] is directly connected, sforouter1, 00:00:26
C>* 10.1.3.0/24 is directly connected, sforouter1
O 10.1.4.0/24 [110/10] is directly connected, sforouter3, 00:00:35
C>* 10.1.4.0/24 is directly connected, sforouter3
O 10.1.5.0/24 [110/10] is directly connected, sforouter2, 00:00:35
C>* 10.1.5.0/24 is directly connected, sforouter2
C>* 127.0.0.0/8 is directly connected, lo0
sforouter> exit
Connection to sanfranciscorouter closed by foreign host.
root@sanfranciscorouter:/home/radmin# ~.
[Connection to zone 'sanfranciscorouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/newyorkrouter/ > newyorkrouter.xml
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z newyorkrouter clone -c /opt/cloudsimulation/zones/newyorkrouter.xml templaterouter
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111217T225139Z.newyorkrouter.clone
Log saved in non-global zone as /zones/newyorkrouter/root/var/log/zones/zoneadm.20111217T225139Z.newyorkrouter.clone
root@cloudinabox:/opt/cloudsimulation/zones# cp ospfd.newyork.conf /zones/newyorkrouter/root/etc/quagga/ospfd.conf
root@cloudinabox:/opt/cloudsimulation/zones# cp zebra.newyork.conf /zones/newyorkrouter/root/etc/quagga/zebra.conf
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z newyorkrouter boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C newyorkrouter
[Connected to zone 'newyorkrouter' console]
newyorkrouter console login: radmin
Password:
Last login: Sat Dec 17 19:35:39 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@newyorkrouter:~$ sudo bash
Password:
Dec 17 22:54:33 newyorkrouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
ipadm create-ip newyorkrouter0
ipadm create-ip newyorkrouter1
ipadm create-addr -T static -a 10.0.14.0/24 newyorkrouter0/v4
ipadm create-addr -T static -a 10.1.5.254/24 newyorkrouter1/v4
root@newyorkrouter:/home/radmin# telnet localhost 2602
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to newyorkrouter.
Escape character is '^]'.
Hello, this is Quagga (version 0.99.8).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
newyorkrouter> show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
O>* 10.0.10.0/24 [110/20] via 10.1.5.1, newyorkrouter1, 00:00:22
O>* 10.0.11.0/24 [110/20] via 10.1.5.1, newyorkrouter1, 00:00:22
O>* 10.0.12.0/24 [110/20] via 10.1.5.1, newyorkrouter1, 00:00:22
O>* 10.0.13.0/24 [110/20] via 10.1.5.1, newyorkrouter1, 00:00:22
C>* 10.0.14.0/24 is directly connected, newyorkrouter0
O>* 10.1.1.0/24 [110/30] via 10.1.5.1, newyorkrouter1, 00:00:23
O>* 10.1.2.0/24 [110/30] via 10.1.5.1, newyorkrouter1, 00:00:23
O>* 10.1.3.0/24 [110/20] via 10.1.5.1, newyorkrouter1, 00:00:23
O>* 10.1.4.0/24 [110/20] via 10.1.5.1, newyorkrouter1, 00:00:23
O 10.1.5.0/24 [110/10] is directly connected, newyorkrouter1, 00:00:25
C>* 10.1.5.0/24 is directly connected, newyorkrouter1
C>* 127.0.0.0/8 is directly connected, lo0
newyorkrouter> exit
Connection to newyorkrouter closed by foreign host.
root@newyorkrouter:/home/radmin# ~.
[Connection to zone 'newyorkrouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C newyorkrouter
[Connected to zone 'newyorkrouter' console]
root@newyorkrouter:/home/radmin#
root@newyorkrouter:/home/radmin#
root@newyorkrouter:/home/radmin# ping 10.0.10.254
10.0.10.254 is alive
root@newyorkrouter:/home/radmin# traceroute 10.0.10.254
traceroute: Warning: Multiple interfaces found; using 10.1.5.254 @ newyorkrouter1
traceroute to 10.0.10.254 (10.0.10.254), 30 hops max, 40 byte packets
1 10.1.5.1 (10.1.5.1) 0.116 ms 0.083 ms 0.038 ms
2 10.1.3.1 (10.1.3.1) 0.072 ms 0.048 ms 0.041 ms
3 10.0.10.254 (10.0.10.254) 0.065 ms 0.077 ms 0.047 ms
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C sanfranciscorouter
[Connected to zone 'sanfranciscorouter' console]
root@sanfranciscorouter:/home/radmin#
root@sanfranciscorouter:/home/radmin#
root@sanfranciscorouter:/home/radmin# ipadm disable-if sforouter1
ipadm: persistent operation not supported for disable-if
root@sanfranciscorouter:/home/radmin# ipadm disable-if -t sforouter1
root@sanfranciscorouter:/home/radmin# ~.
bash: ~.: command not found
root@sanfranciscorouter:/home/radmin# ~.
[Connection to zone 'sanfranciscorouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C newyorkrouter
[Connected to zone 'newyorkrouter' console]
root@newyorkrouter:/home/radmin# traceroute 10.0.10.254
traceroute: Warning: Multiple interfaces found; using 10.1.5.254 @ newyorkrouter1
traceroute to 10.0.10.254 (10.0.10.254), 30 hops max, 40 byte packets
1 10.1.5.1 (10.1.5.1) 0.114 ms 0.141 ms 0.132 ms
2 10.1.4.1 (10.1.4.1) 0.072 ms 0.046 ms 0.041 ms
3 10.1.2.1 (10.1.2.1) 0.065 ms 0.066 ms 0.048 ms
4 10.0.10.254 (10.0.10.254) 0.073 ms 0.068 ms 0.052 ms
root@newyorkrouter:/home/radmin# ~.
[Connection to zone 'newyorkrouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones#
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C sanfranciscorouter
[Connected to zone 'sanfranciscorouter' console]
root@sanfranciscorouter:/home/radmin#
root@sanfranciscorouter:/home/radmin# ipadm enable-if -t sforouter1
root@sanfranciscorouter:/home/radmin#
root@sanfranciscorouter:/home/radmin# ~.
[Connection to zone 'sanfranciscorouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones#
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C newyorkrouter
[Connected to zone 'newyorkrouter' console]
root@newyorkrouter:/home/radmin# traceroute 10.0.10.254
traceroute: Warning: Multiple interfaces found; using 10.1.5.254 @ newyorkrouter1
traceroute to 10.0.10.254 (10.0.10.254), 30 hops max, 40 byte packets
1 10.1.5.1 (10.1.5.1) 0.361 ms 0.044 ms 0.037 ms
2 10.1.3.1 (10.1.3.1) 0.061 ms 0.046 ms 0.042 ms
3 10.0.10.254 (10.0.10.254) 0.070 ms 0.052 ms 0.048 ms
root@newyorkrouter:/home/radmin# ~.
[Connection to zone 'newyorkrouter' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/londonsrv1/ > londonsrv1.xml
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z londonsrv1 -f londonsrv1
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z londonsrv1 clone -c /opt/cloudsimulation/zones/londonsrv1.xml templateserver
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111218T043435Z.londonsrv1.clone
Log saved in non-global zone as /zones/londonsrv1/root/var/log/zones/zoneadm.20111218T043435Z.londonsrv1.clone
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z londonsrv1 boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C londonsrv1
[Connected to zone 'londonsrv1' console]
londonsrv1 console login: radmin
Password:
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@londonsrv1:~$ sudo bash
Password:
Dec 18 04:53:49 londonsrv1 sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
root@londonsrv1:/home/radmin# ipadm create-ip londonsrv1
root@londonsrv1:/home/radmin# ipadm create-addr -T static -a 10.0.10.10/24 londons
rv1/v4
root@londonsrv1:/home/radmin# route -p add default 10.0.10.254
add net default: gateway 10.0.10.254
add persistent net default: gateway 10.0.10.254
root@londonsrv1:/home/radmin# ping 10.0.10.254
10.0.10.254 is alive
root@londonsrv1:/home/radmin# traceroute 10.0.13.254
traceroute to 10.0.13.254 (10.0.13.254), 30 hops max, 40 byte packets
1 10.0.10.254 (10.0.10.254) 0.238 ms 0.051 ms 0.044 ms
2 10.1.1.1 (10.1.1.1) 0.098 ms 0.057 ms 0.053 ms
3 10.0.13.254 (10.0.13.254) 0.072 ms 0.059 ms 0.061 ms
root@londonsrv1:/home/radmin# ~.
[Connection to zone 'londonsrv1' console closed]
root@cloudinabox:/opt/cloudsimulation/zones# cat template.xml | sed s/jamphfhn/newyorksrv1/ > newyorksrv1.xml
root@cloudinabox:/opt/cloudsimulation/zones# cat londonsrv1londonsrv1 londonsrv1.xml
root@cloudinabox:/opt/cloudsimulation/zones# cat londonsrv1 | sed s/londonsrv1/newyorksrv1/ > newyorksrv1
root@cloudinabox:/opt/cloudsimulation/zones# vi newyorksrv1
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z newyorksrv1 -f newyorksrv1
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z newyorksrv1 clone -c /opt/cloudsimulation/zones/newyorksrv1.xml templateserver
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111218T050558Z.newyorksrv1.clone
Log saved in non-global zone as /zones/newyorksrv1/root/var/log/zones/zoneadm.20111218T050558Z.newyorksrv1.clone
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z newyorksrv1 boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C newyorksrv1
root@cloudinabox:/home/jmoekamp# zlogin -C newyorksrv1
[Connected to zone 'newyorksrv1' console]
newyorksrv1 console login: radmin
Password:
Last login: Sun Dec 18 05:38:10 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@newyorksrv1:~$ sudo bash
Password:
root@newyorksrv1:/home/radmin# ipadm create-ip newyorksrv1
root@newyorksrv1:/home/radmin# ipadm create-addr -T static -a 10.0.14.10/24 new
yorksrv1/v4
root@newyorksrv1:/home/radmin# route -p add default 10.0.14.254
add net default: gateway 10.0.14.254
add persistent net default: gateway 10.0.14.254
root@newyorksrv1:/home/radmin# ping 10.0.14.254
10.0.14.254 is alive
root@newyorksrv1:/home/radmin# traceroute 10.0.10.10
traceroute to 10.0.10.10 (10.0.10.10), 30 hops max, 40 byte packets
1 10.0.14.254 (10.0.14.254) 0.132 ms 0.051 ms 0.044 ms
2 10.1.5.1 (10.1.5.1) 0.068 ms 0.085 ms 0.058 ms
3 10.1.3.1 (10.1.3.1) 0.070 ms 0.057 ms 0.054 ms
4 10.1.1.254 (10.1.1.254) 0.110 ms 0.063 ms 0.058 ms
5 10.0.10.10 (10.0.10.10) 0.085 ms 0.069 ms 0.065 ms
root@newyorksrv1:/home/radmin#
root@cloudinabox:/home/jmoekamp# dladm create-simnet hamburgsw1_250
root@cloudinabox:/home/jmoekamp# dladm create-simnet hamburgsw1_251
root@cloudinabox:/home/jmoekamp# dladm create-simnet hamburgsw2_250
root@cloudinabox:/home/jmoekamp# dladm create-simnet hamburgsw2_251
root@cloudinabox:/home/jmoekamp# dladm create-simnet hamburgsw3_250
root@cloudinabox:/home/jmoekamp# dladm create-simnet hamburgsw3_251
root@cloudinabox:/home/jmoekamp# dladm modify-simnet -p hamburgsw2_250 hamburgsw1_251
root@cloudinabox:/home/jmoekamp# dladm modify-simnet -p hamburgsw3_250 hamburgsw2_251
root@cloudinabox:/home/jmoekamp# dladm modify-simnet -p hamburgsw1_250 hamburgsw3_251
root@cloudinabox:/home/jmoekamp# dladm create-bridge hamburgharbour
root@cloudinabox:/home/jmoekamp# dladm create-bridge hamburgairport
root@cloudinabox:/home/jmoekamp# dladm add-bridge -l hamburgsw1_250 -l hamburgsw1_251 hamburg
root@cloudinabox:/home/jmoekamp# dladm add-bridge -l hamburgsw2_250 -l hamburgsw2_251 hamburgairport
root@cloudinabox:/home/jmoekamp# dladm add-bridge -l hamburgsw3_250 -l hamburgsw3_251 hamburgharbour
root@cloudinabox:/home/jmoekamp# dladm show-bridge -l hamburgharbour
LINK STATE UPTIME DESROOT
hamburgsw3_250 forwarding 55 32768/36:5d:1c:5d:ec:f
hamburgsw3_251 forwarding 55 32768/36:5d:1c:5d:ec:f
root@cloudinabox:/home/jmoekamp# dladm show-bridge -l hamburgairport
LINK STATE UPTIME DESROOT
hamburgsw2_250 forwarding 63 32768/36:5d:1c:5d:ec:f
hamburgsw2_251 forwarding 63 32768/36:5d:1c:5d:ec:f
root@cloudinabox:/home/jmoekamp# dladm show-bridge -l hamburg
LINK STATE UPTIME DESROOT
hamburgsw1_1 forwarding 51355 32768/36:5d:1c:5d:ec:f
hamburgsw1_255 forwarding 51355 32768/36:5d:1c:5d:ec:f
hamburgsw1_250 discarding 193 32768/36:5d:1c:5d:ec:f
hamburgsw1_251 forwarding 193 32768/36:5d:1c:5d:ec:f
root@cloudinabox:/home/jmoekamp# dladm modify-bridge -p 1 hamburg
root@cloudinabox:/opt/cloudsimulation/zones# dladm show-bridge -l hamburg
LINK STATE UPTIME DESROOT
hamburgsw1_1 forwarding 57351 0/da:c6:f6:e6:72:63
hamburgsw1_255 forwarding 57351 0/da:c6:f6:e6:72:63
hamburgsw1_250 forwarding 6189 0/da:c6:f6:e6:72:63
hamburgsw1_251 forwarding 6189 0/da:c6:f6:e6:72:63
root@cloudinabox:/opt/cloudsimulation/zones# dladm show-bridge -l hamburgairport
LINK STATE UPTIME DESROOT
hamburgsw2_250 forwarding 6090 0/da:c6:f6:e6:72:63
hamburgsw2_251 forwarding 6090 0/da:c6:f6:e6:72:63
root@cloudinabox:/opt/cloudsimulation/zones# dladm show-bridge -l hamburgharbour
LINK STATE UPTIME DESROOT
hamburgsw3_250 discarding 6098 0/da:c6:f6:e6:72:63
hamburgsw3_251 forwarding 6098 0/da:c6:f6:e6:72:63
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgairport1
root@cloudinabox:/opt/cloudsimulation/zones# dladm create-simnet hamburgsw2_1
root@cloudinabox:/opt/cloudsimulation/zones# dladm modify-simnet -p hamburgsw2_1 hamburgairport1
root@cloudinabox:/opt/cloudsimulation/zones# dladm add-bridge -l hamburgsw3_1 hamburgairport
root@cloudinabox:/opt/cloudsimulation/zones# dladm show-bridge -l hamburgairport
LINK STATE UPTIME DESROOT
hamburgsw2_250 forwarding 7798 0/da:c6:f6:e6:72:63
hamburgsw2_251 forwarding 7798 0/da:c6:f6:e6:72:63
hamburgsw2_1 forwarding 1088 0/da:c6:f6:e6:72:63
root@cloudinabox:/opt/cloudsimulation/zones# cat londonsrv1 | sed s/londonsrv1/hamburgairport1/ > hamburgairport1
root@cloudinabox:/opt/cloudsimulation/zones# cat londonsrv1.xml | sed s/londonsrv1/hamburgairport1/ > hamburgairport1.xml
root@cloudinabox:/opt/cloudsimulation/zones# zonecfg -z hamburgairport1 -f hamburgairport1
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z hamburgairport1 clone -c /opt/cloudsimulation/zones/hamburgairport1.xml templateserver
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20111218T090703Z.hamburgairport1.clone
Log saved in non-global zone as /zones/hamburgairport1/root/var/log/zones/zoneadm.20111218T090703Z.hamburgairport1.clone
root@cloudinabox:/opt/cloudsimulation/zones# zoneadm -z hamburgairport1 boot
root@cloudinabox:/opt/cloudsimulation/zones# zlogin -C hamburgairport1
[Connected to zone 'hamburgairport1' console]
hamburgairport1 console login: radmin
Password:
Login incorrect
hamburgairport1 console login: radmin
Password:
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@hamburgairport1:~$ sudo bash
Password:
Dec 18 10:20:50 hamburgairport1 sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
root@hamburgairport1:/home/radmin# ipadm create-ip hamburgairport1
root@hamburgairport1:/home/radmin# ipadm create-addr -T static -a 10.0.11.10/24
hamburgairport1/v4
root@hamburgairport1:/home/radmin# route -p add default 10.0.11.254
add net default: gateway 10.0.11.254
add persistent net default: gateway 10.0.11.254
root@hamburgairport1:/home/radmin# ping 10.0.10.254
10.0.10.254 is alive
root@hamburgairport1:/home/radmin# ping 10.0.11.254
10.0.11.254 is alive
root@cloudinabox:/home/jmoekamp# zoneadm -z hamburgrouter halt
root@cloudinabox:/home/jmoekamp# zoneadm -z hamburgrouter boot
root@cloudinabox:/home/jmoekamp# zlogin -C hamburgrouter
[Connected to zone 'hamburgrouter' console]
hamburgrouter console login: radmin
Password:
Last login: Sat Dec 17 21:23:39 on console
Oracle Corporation SunOS 5.11 11.0 November 2011
radmin@hamburgrouter:~$ sudo bash
Password:
Dec 18 15:34:23 hamburgrouter sudo: radmin : TTY=console ; PWD=/home/radmin ; USER=root ; COMMAND=/usr/bin/bash
root@hamburgrouter:/home/radmin# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 unknown --
hamburgrouter0 simnet 1500 up ?
hamburgrouter1 simnet 1500 up ?
hamburgrouter2 simnet 1500 up ?
hamburgrouter3 simnet 1500 up ?
root@hamburgrouter:/home/radmin# dladm show-link net0
LINK CLASS MTU STATE OVER
net0 phys 1500 unknown --
root@hamburgrouter:/home/radmin# ipadm create-ip net0
root@hamburgrouter:/home/radmin# ipadm create-addr -T static -a 192.168.1.83/24 net0/v4
root@hamburgrouter:/home/radmin# ping 192.168.1.1
192.168.1.1 is alive
root@hamburgrouter:/home/radmin# ping 192.168.1.200
192.168.1.200 is alive
root@hamburgrouter:/home/radmin# ~.
[Connection to zone 'hamburgrouter' console closed]
root@cloudinabox:/home/jmoekamp# zlogin -C newyorkrouter
[Connected to zone 'newyorkrouter' console]
root@newyorkrouter:/home/radmin# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
10.0.10.0 10.1.5.1 UG 1 0
10.0.11.0 10.1.5.1 UG 1 0
10.0.12.0 10.1.5.1 UG 1 0
10.0.13.0 10.1.5.1 UG 1 0
10.0.14.0 10.0.14.254 U 3 32 newyorkrouter0
10.1.1.0 10.1.5.1 UG 1 0
10.1.2.0 10.1.5.1 UG 1 0
10.1.3.0 10.1.5.1 UG 1 0
10.1.4.0 10.1.5.1 UG 1 0
10.1.5.0 10.1.5.254 U 3 17 newyorkrouter1
127.0.0.1 127.0.0.1 UH 2 14 lo0
192.168.1.0 10.1.5.1 UG 1 0
Routing Table: IPv6
Destination/Mask Gateway
No comments:
Post a Comment