Xenomips/en

Материал из Xgu.ru

Перейти к: навигация, поиск

English is not native language for the author of this article.
You can help fixing mistakes and improving the style of the text.

Author: Igor Chubin
Translated from: Xenomips (russian)

Xenomips -- is a Xenolinux virtual machine, working as a Xen domain-U and dedicated to run the Cisco 7200 Simulator Dynamips. The Dynamips interfaces get connected to the network interfaces of the underlying Xen domain.


Содержание

[править] Idea

In 2005, Christophe Fillot started developing a Cisco 7200 platform software emulator for the x86 architecture. This constantly developing project is widely known as Dynamips. Nowadays Dynamips can emulate several router platforms with interfaces of various types.

There is a project, known as Dynagen, which simplifies creation and management of Dynamips based virtual networks. Unfortunately, this project is unable to help in building networks connecting machines of varying types.

However, the well known Xen project allows a person to create virtual machines running various operating systems, in particular Linux, and to organize it into networks of any complexity.

Packaging Dynamips into a Xen virtual machine allows us to achieve several interesting results.


[править] Advantages

[править] Possibility to build heterogenous networks

Using Xen and Xenomips it's very easy to build heterogenous networks, that contain virtual machines of many types running various operating systems. For example, it's a very simple task to build a virtual network that comprises of several virtual Cisco routers, connecting virtual Windows XP (*), Windows 2003 Server, Linux and OpenSolaris machines.

(*) The host platform must have HVM-capable CPUs to run Windows in Xen domains.

[править] Unified management tools

Tools to manage Xen virtual machines (Linux, FreeBSD, OpenSolaris, Windows) and Dynamips machines are common. Existing and emerging tools designed to manage Xen virtual machines can be used to manage Dynamips instances, too, particularly for managing CPU scheduling and memory allocation.

[править] Migration and live migration of Dynamips routers

A state of an entire virtual network can be saved and restored at any moment. A virtual network can fully or partially migrated from one system to another without stopping and even pausing it.

[править] Inter Dynamips traffic management by means of Linux

The network interfaces of the Xen domains are connected via Linux bridges in the Xen domain 0. All of this interfaces are visible in domain 0, so traffic between these interfaces can be managed with Linux traffic management mechanisms like iptables, ebtables and QoS-tools.

[править] Disadvantages

[править] Extra memory consumption

Xenomips requires more physical memory for each instance than Dynamips itself. Physical memory is consumed by each operating system running a Dynamips process.

[править] Dynamips interfaces

At this time only the ethernet interfaces are available in Xenomips from the wealth of available Dynamips interface.

This drawback should be eliminated in the future.

[править] Prerequisites

Software requirements:

  • Xen. The host system must work under Xenolinux. This HowTo presupposes that Xen is installed and configured and all operations are carried out in the Xen domain 0. If you have no Xen system prepared yet, prepare it according to the Xen documentation.
  • Debian GNU/Linux. You may use other Linux distributions, but image preparation is slightly simpler when using Debian. If you use an already prepared xenomips image, you can use a Linux of any flavour. Our procedure here is for Debian GNU/Linux.
  • Dynamips is not necessary to begin experiments. Although, you must know that Dynamips is one of the most important parts of Xenomips, and so you'll have to download, build and install it.

Hardware requirements:

  • No special demands compared to Xen and Dynamips.

It should be noted that the most valuable resource while experimenting with Xen and Dynamips is physical memory. Relatively interesting experiments can be conducted starting at 2GB of system memory.

[править] Virtual Machine Preparation

[править] Automagical preparation with script

There is no script for automagical Xenomips image creation at this moment. When the script will be written, you will be able to create Xenomips virtual machine image in this way:

%# wget http://xgu.ru/xenomips/install
%# sh install

During the execution of the script all of the actions described below will be carried out.

[править] Manual Virtual Machine Preparation

The Xenomips virtual machine consists of several filesystems, the most important being the root filesystem. They live on LVM devices or image files.

[править] Xenomips root filesystem creation

Preparing a Xenomips root filesystem consists of several steps, including:

  • creating an empty filesystem;
  • filling it with the base Linux system;
  • installing necessary software packages;
  • editing configuration files.
[править] Creation of an empty xenomips root filesystem

If you want the filesystem to be placed on a logical LVM volume:

%# lvcreate -L 2048M -n xenomips0 /dev/NAS0
%# mkfs.ext3 /dev/NAS0/xenomips0
%# mount /dev/NAS0/xenomips0 /mnt

That is to create a logical volume with 2G size on the /dev/NAS0 volume group (we actually need less space, 2G is only to be sure to have enough free space).

If you want to use a regular image file as backend for the Xenomips filesystem, use slightly different command sequence:

%# dd if=/dev/zero of=xenomips0.img bs=1024k count=2048
%# mkfs.ext3 xenomips0.img
%# mount -o loop xenomips0.img /mnt

The image file will be created in your current directory.

The Xenomips root filesystem will be mounted at /mnt. Further work will be done in this directory.

[править] Run debootstrap

Install etch Debian GNU/Linux base:

%# debootstrap etch http://192.168.15.251:9999/debian/ /mnt

Here we have used address of local apt-proxy (http://192.168.15.251:9999/debian/), you must specify address of local Debian mirror instead.

After you have installed the Linux base, chroot into the /mnt directory.

%# chroot /mnt

Further work with Xenolinux root filesystem is conducted in this restricted environment. After work will be done, you may leave chrooted environment using command exit.

[править] Installation of additional packages

Packages, necessary to run Linux:

  • openssh-server
  • libc6-xen

Packages, necessary to run Dynamips:

  • libelf1
  • libpcap

To install these packages you have to run the command:

%# apt-get install openssh-server libc6-xen libelf1 libpcap
[править] Set root password

If you intend to login to the Linux system using SSH, you need to set a root password:

 %# passwd
 Enter new password: rootpass
[править] Edit /etc/fstab

Edit /etc/fstab:

proc            /proc           proc            defaults                0       0
tmpfs           /tmp            tmpfs           defaults,nosuid,nodev   0       0

/dev/hda1       /                       ext3    ro              0       0
/dev/hda2       /data/Cisco_IOS         ext3    ro              0       0
/dev/hda3       /xenomips               ext3    rw              0       0

The partition /dev/hda1 contains the Xenomips root filesystem. We have created that already.

The partition /dev/hda2 contains the IOS images.

The partition /dev/hda3 will contain the Dynamips working files. This partition must be mounted in read-write mode.

[править] Edit /etc/network/interfaces

Edit /etc/network/interfaces like this:

auto lo eth0

iface lo inet loopback 
        up for i in `ifconfig -a | grep 'eth.*Link encap' | awk '{print $1}'`; do ifconfig $i up ; done

iface eth0 inet dhcp

This means:

  • Automatically activate the interfaces lo and eth0
  • When the interface lo is successfuly activated, run a script which finds all of the ethernet interfaces in the system and turn them up without any additional configuration (like IP addresses).
  • Turn interface eth0 up using DHCP. We will use eth0 as service interface, by means of which we will access Linux virtual machine. Dynamips will not get connected to this interface.

The tricky script specified in up statement of lo interface is necessary because of the fact that Dynamips will not work via shut down interfaces but all interfaces are shut down by default.

As we don't know the number of interfaces in the Xenomips instance, we need to activate all of them.

[править] Edit system boot scripts

In order to start Dynamips during the system's boot process, add a call of the xenomips.sh script to file /etc/rc.local:

/usr/local/bin/xenomips.sh

The script xenomips.sh runs Dynamips. The Dynamips process doesn't detach from the console. The system's boot sequence ends here.

Xenomips' root filesystem must be used in read-only mode. The init script xenomips-init makes Xenomips ready to use its root filesystem read-only. We create /etc/init.d/xenomips-init later, but we may put it into our runlevel now:

# cd /etc/rc2.d; ln -s ../init.d/xenomips-init S20xenomips-init
[править] Dynamips installation

Build Dynamips within the base system, so leave the restricted environment where you set up your Xenomips system.

%# exit

The build code must be installed into the directory tree in /mnt.

To build Dynamips from the source you must have following packages installed:

  • libelf-dev
  • libpcap-dev (точнее, libpcap0.8-dev)

You can install this packages using the command:

%# apt-get install libelf-dev libpcap0.8-dev 

It is not necessary to have this packages installed in the Xenomips virtual machine thyself. These packages are needed during build process only.

The build process:

%# wget http://   # You must find correct URL at the Dynamips site
%# tar xvfz dynamips*
%# cd dynamips*
%# make
%# make install DESTDIR=/mnt
[править] Xenomips installation

You need to create directories which will be used during system run and copy lacking scripts.

Create the directories /xenomips/, /var/lib/xenomips, /data/Cisco_IOS:

%# mkdir -p /xenomips/ /var/lib/xenomips/ /data/Cisco_IOS/

Copy (or create) Xenomips scripts:

  • /usr/local/bin/xenomips.sh
  • /etc/init.d/xenomips-init

Script xenomips.sh

#!/bin/sh

DYNAMIPS_WORKDIR="/xenomips"
DYNAMIPS_ARGS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'`


cd "$DYNAMIPS_WORKDIR"
dynamips $DYNAMIPS_ARGS

The script cuts Dynamips command line arguments out of parameter xenomips="..." that must be passed to Linux kernel as its argument. After that scripts changes current directory to /xenomips and runs Dynamips. Dynamips will save its working files (particulary, IOS configs) in this directory.

Script xenomips-init (The script is based on the script taken from LTSP project.)

#!/bin/sh

bind_mounts () {
  # set defaults
  test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/xenomips
  test -z "$rw_dirs" && rw_dirs="/var/cache/man /var/lock /var/run /var/log /var/spool /var/tmp /tmp /var/lib/urandom"
  test -z "$copy_dirs" && copy_dirs=""
  test -z "$temp_copy_dirs" && temp_copy_dirs="/var/cache/debconf"
  test -z "$bindfiles" && bindfiles=""
  mount -t tmpfs -o mode=0755 tmpfs $tmpfs_dir
  # preserve directory structure
  for d in $rw_dirs ; do
    if [ -d "$d" ]; then
      cd $tmpfs_dir
      tar --no-recursion -cpf - $(find $d -type d 2> /dev/null) 2> /dev/null | tar xpf -
      mount --bind $tmpfs_dir/$d $d
    else
      echo "WARNING: $d does not exist"
    fi
  done  
  # copy contents into tmpfs
  for d in $copy_dirs $temp_copy_dirs; do
    if [ -d "$d" ]; then
      cd $tmpfs_dir
      tar -cpf - $d 2> /dev/null | tar xpf -
      mount --bind $tmpfs_dir/$d $d
    else
      echo "WARNING: $d does not exist"
    fi
  done
  # mount one file on top of another
  for f in $bindfiles ; do
    if [ -e "$f" ]; then
      mkdir -p "$(dirname $tmpfs_dir/$f)"
      cp $f $tmpfs_dir/$f
      mount --bind $tmpfs_dir/$f $f
    else
      echo "WARNING: $f does not exist"
    fi
  done
  touch /var/log/dmesg
}


bind_mounts

This script configures the system to use its root filesystem read-only. It must be run at system boot.

[править] Completion of image preparation

When image preparation is finished, you can unmount it:

%# umount /mnt

In case we have to modify it we mount it again. E.g. if we find out that we have to install additional software into the image:

%# mount /dev/NAS0/xenomips0 /mnt
%# chroot /mnt
%# apt-get install ______
%# exit
%# umount /mnt

[править] Creation of the image for the Xenomips work files

The root filesystem of a Xenomips is mounted read-only. Nevertheless, there should be a file system containing varying files - the Xenomips work files.

For that purpose the usage of a separate image file is suggested. The file is accessed by the virtual machine as an independent filesystem. Each Xenomips instance needs one such image file.

As you can see from the virtual machine's /etc/fstab shown below, its partition /dev/hda3 is mounted at /xenomips. This directory will be the working directory for the Dynamips process.

Image file creation:

%# dd if=/dev/zero of=/root/xenomips/images/xenomips.img bs=1024k count=100
%# mkfs.ext3 /root/xenomips/images/xenomips.img
%# cp /root/xenomips/images/xenomips.img /root/xenomips/images/xenomips0.img

In this case one base file is created copied for each Xenomips instance. It is supposed to place these files in the domain0's directory /root/xenomips/images/.


[править] Creation of the partition for the IOS images

The IOS image file may be copied into the root filesystem of Xenomips. But it's better to copy it into a separate partition and mount that in each Xenomips domain read-only.

If you use LVM:

%# lvcreate -n ios -L 2048M /dev/NAS0
%# mkfs.ext3 /dev/NAS0/ios
%# mount /dev/NAS0/ios /mnt
%# cp /path/to/ios/images/* /mnt
%# umount /mnt

If you use regular files:

%# dd if=/dev/zero of=ios-images.img count=2048 bs=1024k
%# mkfs.ext3 ios-images.img
%# mount -o loop ios-images.img /mnt 
%# cp /path/to/ios/images/* /mnt
%# umount /mnt

You can decompress IOS images to speed up Dynamips start.

[править] Xenomips Virtual Machine config file

Configuration files of Xen virtual machines -- are Python scripts. As a rule, the only one operation, which is used in the scripts is the assignment operation. This, however, does not exhaust the possibilities of Xen configuration files -- you may write any Python programs in it and this makes nontrivial configuring of Xen virtual machines very flexible and easy.

Configuration of Xenomips machines (all the instances at once) defined in only one configuration file.

/etc/xen/xenomips

This file is used when creating virtual machines in this way:

%# xm create xenomips N=0

Here, N is a number of the create Xenomips instance.

The configuration of a Xenomips virtual machine, particulary a number of its network interfaces and a way in which the interfaces are connected to the network, defined in a Xenomips configuration file.

There are all of the configuration file parts described below, after that entire file is shown.


[править] Conventional part

Directives, which present in any Xen domain configuration file and to which you do not need to pay extra attention at this case:

kernel = "/boot/vmlinuz-2.6.18-3-xen-686"
ramdisk = "/boot/initrd.img-2.6.18-3-xen-686"
#builder='linux'
memory = 400

#....

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

It is supposed here, that files /boot/vmlinuz-2.6.18-3-xen-686 and /boot/initrd.img-2.6.18-3-xen-686 exist. You must change values of kernel and ramdisk parameters according do your kernel and ramdisk names.

Physical memory size, specified by memory directive, depends on Dynamips configuration and can be lowered.

[править] Name

The domain name must be unique. Let it be determined by Xen's virtual machine number:

#...
name = "xenomips"+N
#...

E.g. the domain name for Xenomips virtual machine with N=3 will be xenomips3.

[править] Bridges

Virtual machines are interconnected between each other using Linux bridges in the domain 0ю

The names of the bridges, to which interfaces of the machines are connected, are described in list of lists vbridges_table.

For example:

vbridges_table = [
                ['service0', 'xenbr0', 'xenbr1'],
                ['service0', 'xenbr1', 'xenbr2'],
                ['service0', 'xenbr0', 'xenbr2']
                 ]

In this case machine N=0 is connected by its interfaces to:

  • eth0 to the bridge service0
  • eth1 to the bridge xenbr0
  • eth2 to the bridge xenbr1

And, for example, machine N=2 is connected to the bridges:

  • eth0 to the bridge service0
  • eth1 to the bridge xenbr0
  • eth2 to the bridge xenbr2

It supposed that eth0 interfaces will be used in service purposes only (e.g. to connect to virtual Linux using SSH), and the other interfaces will be connected to the Dynamips. More details are below.

The bridges service0, xenbr0 and xenbr1 must be created and set up:

%# brctl addbr service0
%# ifconfig service0 up

You can find more information about Linux bridges here:

[править] MAC-addresses

Xen assigns MAC-addresses to the virtual interfaces of the virtual machines. However, Dynamips sends ethernet frames using its own MAC-addresses.

MAC-addresses for Xen and Dynamips machines:

  • 00:16:3e:01:XX:YY - for Xen
  • 00:16:3e:02:XX:YY - for Dynamips (we will use address MAC addresses from Xen Vendor ID range for Dynamips, although strictly speaking is not correct)

Let take XX and YY numbers according to the rule:

  • XX=N , where N - is the number of the machine.
  • YY=C0+K, where K is the number of the interface (ethK).

Using this method of MAC-address assignment, we can address up to 256 machines, with up to 64 network interfaces in each machine.

The list vif of the virtual network interfaces is generated this way:

#...
vif=[]
x=1
for i in vbridges:
  vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
  x+=1
#...

Say N='1', and vbridges is

vbridges=['service0', 'xenbr1', 'xenbr2']

then this list will be generated:

vif=['bridge=service0,mac=00:16:3e:01:1:c1', 'bridge=xenbr1,mac=00:16:3e:01:1:c2', 'bridge=xenbr2,mac=00:16:3e:01:1:c3']

[править] Disks

Virtual machine must have access to three virtual partitions:

  1. The Debian GNU/Linux root filesystem (one for all machines);
  2. The filesystem containing the IOS images (one for all machines);
  3. The filesystem containing the Dynamips working files (distinct for every machine).

The first and the second filesystem may be shared between machines if they get mounted read-only. The third one contains the Dynamips working files, in particular the Dynamips IOS configuration. This image should be mounted read-write, so it can't be shared between machines and must be distinct for each machine.

So, the list disk in the Xenomips machine config file will look like that:

#...
disk = [ 'phy:/dev/NAS0/xenomips0,hda1,r', 'phy:/dev/NAS0/ios,hda2,r', 'file:/root/xenomips/images/xenomips'+N+'.img,hda3,w' ]
#...

The first and the second devices are backed on LVM logical volumes; the third on a regular image file, accessed via the loopback device.

The name of the latter depends on virtual machine number N. For example, if N=1, filename will have such a name:

/root/xenomips/images/xenomips1.img

If you use file backed devices instead of LVM, you must change the configuration file accordingly.

[править] Dynamips

Command line arguments of the Dynamips, which will be running inside virtual machine, is passed as command line arguments of the Linux kernel. After that, when operating system boots, it finds that arguments and passes it to the Dynamips when it is being called.

Example of the Linux kernel command line:

linux ro root=/dev/hda1 xenomips="....."

So, command line arguments we want to pass to the Dynamips process, we must specify in quotes in paramter xenomips of the Linux kernel.

Such information is passed as arguments:

  • filename of IOS image
  • -m - the basic chassis MAC-address (see above)
  • -p - description of the network adapters
  • -s - description of the network adapters connections

Let Dynamips have as many adapters as Linux has (actually, by one adapter fewer -- Linux service interface is not getting connected to a Dynamips). This is the most configuration, but not the only one.

Let adapters be connected to interfaces of a virtual machine.

There is always at least one adapter in the Dynamips. The rest are created using key -p. For example:

-p 1:PA-FE-TX -p 2:PA-FE-TX

This options mean: add 2 FastEthernet adapters to the Dynamips instance.

There are many variants of Dynamips virtual machines interfaces connections to Xen domain interfaces. In particular, the Dynamips interfaces may be directly connected to the Linux interfaces:

-s 0:0:gen_eth:eth0

This means: connect the Dynamips interface fa0/0 to the Linux interface eth0.

We will automatically have connected the faX/0 Cisco interfaces to the ethX+1 Linux interfaces (eth0 interfaces is used for service purposes).

#....
xenomips='/data/Cisco_IOS/C7200-JK.BIN -m 00:16:3e:02:'+hex(int(N))[2:]+':01'

for i in range(len(vbridges)-2):
 xenomips += ' -p '+str(i+1)+':PA-FE-TX'

for i in range(len(vbridges)-1):
 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i+1)

extra = "xenomips=\""+xenomips+"\""
#...

[править] Configuration file

The final version of the Xenomips virtual machine config file is shown below.

This file must be placed in /etc/xen of domain 0 Xenolinux host system.

kernel = "/boot/vmlinuz-2.6.18-3-xen-686"
ramdisk = "/boot/initrd.img-2.6.18-3-xen-686"
#builder='linux'
memory = 400

name = "xenomips"+N

vbridges_table = [
                ['service0', 'xenbr0', 'xenbr1'],
                ['service0', 'xenbr1', 'xenbr2'],
                ['service0', 'xenbr0', 'xenbr2']
                 ]

vbridges = vbridges_table[int(N)]

vif=[]
x=1
for i in vbridges:
 vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:])
 x+=1


disk = [ 'phy:/dev/NAS0/xenomips0,hda1,r', 'phy:/dev/NAS0/ios,hda2,r', 'file:/root/xenomips/images/xenomips'+N+'.img,hda3,w' ]
root = "/dev/hda1 ro"

#xenomips='/data/Cisco_IOS/C7200-JK.BIN -m 00:16:3e:01:'+hex(int(N))[2:]+':01 -p 1:PA-FE-TX -p 2:PA-FE-TX -s 0:0:linux_eth:eth1 -s 1:0:gen_et
h:eth2'
xenomips='/data/Cisco_IOS/C7200-JK.BIN -m 00:16:3e:01:'+hex(int(N))[2:]+':01'

for i in range(len(vbridges)-2):
 xenomips += ' -p '+str(i+1)+':PA-FE-TX'

for i in range(len(vbridges)-1):
 xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i+1)

extra = "xenomips=\""+xenomips+"\""

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

[править] Virtual Machine start

Run virtual machines in conventional way:

%# xm create xenomips N=0
%# xm create xenomips N=1
%# xm create xenomips N=2

If you need to create several domains at once, you can use shell iterator:

%# for i in `seq 1 10`; do xm create xenomips N=$i; done

Attention! Each virtual machine needs appreciable amount of RAM, so you must be sure that physical memory of host system is enough to allocate and run desired number of domains. For example, you will need more than 4G of RAM to run 10 machines, if every domain uses 400M of memory.

After the domains were started, you can see if they run:

%# xm list
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0      555     1 r-----   1433.8
ltsp0                                     15      256     1 -b----     24.0
xenomips0                                 43      400     1 ------     13.7
xenomips1                                 44      400     1 ------     13.2
xenomips2                                 45      400     1 ------     13.2

[править] Use

You can attach to the virtual machine's console using this command:

%# xm console xenomips0

Detach from Xen console can be done using the keys ^] (Ctrl+]).

Attention! The escape-sequences of Xen and Dynamips are the same, so you can't use Dynamips escape sequence while you are in Xen console. If you need to work with Linux that runs Dynamips, use SSH access via the Xenomips service interface.

Another way: before building Dynamips you can change its source and specify another escape-sequence for it.

I suggest to use GNU Screen. Using this program you can attach to consoles of Xen domains inside of separate screen windows. It's very convenient.

All of the actions which can be done with Xen domains can be done with Xenomips domains: saving and restoring, migrating, live migrating and so on.

You can read more about Xen domains usage here:

[править] Test

A router does not need special configuration options.
An example configuration:

router0>ena
router0#show run
Building configuration...

Current configuration : 864 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname router0
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
ip cef
ip audit po max-events 100
no ftp-server write-enable
!         
no crypto isakmp enable
!         
interface FastEthernet0/0
 ip address 192.168.15.170 255.255.255.0
 duplex half
!         
interface FastEthernet1/0
 ip address 192.168.16.1 255.255.255.0
 duplex half
!         
router ospf 10
 log-adjacency-changes
!         
router ospf 1
 log-adjacency-changes
 network 192.168.15.0 0.0.0.255 area 0
 network 192.168.16.0 0.0.0.255 area 0
!         
ip classless
no ip http server
no ip http secure-server
!         
control-plane
!   
gatekeeper
 shutdown 
!         
!         
line con 0
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login    
!         
end

Ping real machines:

router0#ping 192.168.15.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.15.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/76/92 ms

Ping virtual machines:

#ping 192.168.17.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.17.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 84/208/360 ms

Check if OSPF works correctly:

router0#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.15.0/24 is directly connected, FastEthernet0/0
O    192.168.17.0/24 [110/2] via 192.168.16.2, 12:52:45, FastEthernet1/0
                     [110/2] via 192.168.15.171, 12:52:45, FastEthernet0/0
C    192.168.16.0/24 is directly connected, FastEthernet1/0
router0#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.17.1      1   FULL/BDR        00:00:34    192.168.16.2    FastEthernet1/0
192.168.17.2      1   FULL/BDR        00:00:39    192.168.15.171  FastEthernet0/0


[править] Thanks

  • Thanks to developers of Xen and Dynamips for the possibilty of work with such marvellous things they give.
  • Thanks to Cisco trainer Igor Podolioukh who has made me familiar with cisco routers and has pointed me at Dynamips project, and has answered my silly questions concerning Cisco Routers I asked him.
  • Thanks to Nils Toedtmann who has helped to translate russian version of this page into English.

[править] Feedback

If you have ideas, comments or suggestions, write it:

  • on the discussion page
  • to author of the page via e-mail igor @ chub.in
Xentaur
Xentaur

Инсталляция и использование Xentaur
Инсталляция | Консоль | Интеграция с реальной сетью | Описание сети
(репозиторий: http://xgu.ru/hg/xentaur)
Компоненты
Узлы: Xen | Xenomips (Dynamips + Pixemu + Xen) | Qemu
Сеть: linux bridges | ebtables | vnet | gvpe | vde | QoS в Linux | iptables
Управление: IPython | GNU Screen
Источник — «http://xgu.ru/wiki/Xenomips/en»