2 Netkit-Lab Single-Host PDF
2 Netkit-Lab Single-Host PDF
netkit lab
single-host
Version 2.2
Author(s) G. Di Battista, M. Patrignani, M. Pizzonia, M.
Rimondini
E-mail [email protected]
Web http://www.netkit.org/
Description how to set up and manage a single virtual machine
copyright notice
All the pages/slides in this presentation, including but not limited to, images,
photos, animations, videos, sounds, music, and text (hereby referred to as
material) are protected by copyright.
This material, with the exception of some multimedia elements licensed by other
organizations, is property of the authors and/or organizations appearing in the first
slide.
This material, or its parts, can be reproduced and used for didactical purposes
within universities and schools, provided that this happens for non-profit purposes.
Information contained in this material cannot be used within network design
projects or other products of any kind.
Any other use is prohibited, unless explicitly authorized by the authors on the basis
of an explicit agreement.
The authors assume no responsibility about this material and provide this material
as is, with no implicit or explicit warranty about the correctness and
completeness of its contents, which may be subject to changes.
This copyright notice must always be redistributed together with the material, or
its portions.
Computer Networks
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007
single host
netkit little by little: just a single virtual machine
suggestion: before setting up a netkit lab, always
make a clear diagram of the scenario that you are
going to emulate!
a simple scenario: 10.0.0.0/24
eth0
pc1 collision domain 0
10.0.0.1/24
Computer Networks
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007
step 1 creating a virtual machine
host
host machine
machine
list
list currently
currently
active
active vms
vms
user@localhost:
user@localhost:~$ vlist
USER VHOST PID SIZE INTERFACES
user@localhost:
user@localhost:~$
$ vstart pc1 --eth0=A
--eth0=A
start
start aa vm
vm
aavirtual
virtualfilesystem
filesystemforfor
whose
whose name
name isis pc1
pc1 pc1isisautomatically
pc1 automatically
created;
created;ititwill
willbe
bestored
stored
inside pc1.disk on
insidepc1.disk onthe
the
that
that has
has aa network
network interface
interface host
hostmachine
machine
Computer Networks
on
on the
the collision
collision domain
domain called
called AA
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007
step 2 logging on pc1
a window containing pc1s console pops up
once the bootstrap of pc1 is terminated, a
shell prompt is automatically displayed
pc1
pc1
--- Netkit phase 2 init script terminated
pc1 login:
login: root (automatic login)
login)
Linux pc1 2.6.11.7 #1 Tue Sep 13 18:38:01 CEST 2005 i686 GNU/Linux
GNU/Linux
Welcome to Netkit
pc1:~#
list
list vm
vm filesystems
filesystems file
file name
name
user@localhost:~$
user@localhost:~$ ls -l *.disk
*.disk
-rw-
rw-r--r
--r-- 1 user group 630358016 2006-
2006-02-
02-02 16:07 pc1.disk
pc1.disk
user@localhost:~$
user@localhost:~$
size
size (actual
(actual disk
disk update
update time
time
user
user usage
usage isis smaller)
smaller)
Computer Networks
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007
step 4 configuring the network
interface of pc1
pc1
pc1
pc1:~# ifconfig eth0 10.0.0.1 netmask 255.255.255.0 broadcast
10.0.0.255 up
automatically
automaticallyassigned
assignedmac
macaddress
address
pc1:~# ifconfig eth0
eth0 Link encap:
encap:Ethernet HWaddr FE:FD:0A:00:00
FE:FD:0A:00:00:01
00:01
inet addr:10.0.0.1
addr:10.0.0.1 Bcast:10.0.0.255
Bcast:10.0.0.255 Mask:255.255.255.0
Mask:255.255.255.0
inet6 addr:
addr: fe80::fcfd
fe80::fcfd:
fcfd:aff:fe00:1/64
aff:fe00:1/64 Scope:Link
Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Metric:1
RX packets:0
packets:0 errors:0
errors:0 dropped:0
dropped:0 overruns:0
overruns:0 frame:0
frame:0
TX packets:3
packets:3 errors:0
errors:0 dropped:0
dropped:0 overruns:0
overruns:0 carrier:0
carrier:0
collisions:0
collisions:0 txqueuelen:1000
txqueuelen:1000
interface
interface status
status
RX bytes:0
bytes:0 (0.0 b) TX bytes:238
bytes:238 (238.0 b)
Interrupt:5
Interrupt:5
pc1:~#
Computer Networks
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007
step 5 checking the routing table
the routing table has been automatically updated
when the interface has been brought up:
pc1
pc1
pc1:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
pc1:~#
next
next hop
hop the
the ifif status
status isis UP
UP
from outside
host
host machine
machine
user@localhost:
user@localhost:~$ vhalt pc1
Halting virtual machine "pc1" (PID 3559) owned by user [........ ]
user@localhost:~$
user@localhost:~$
Computer Networks
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007
step 6 shutting down the vm
from outside, brute force
host
host machine
machine
user@localhost:~$
user@localhost:~$ vcrash pc1
Computer Networks
Research Group Roma Tre netkit [ lab: single-host ] last update: Apr 2007