lost and found ( for me ? )

Ubuntu 12.04 desktop 64bit : coreemu

I’m newbie to coreemu.
IMO , I think coreemu seems to be similar to dynamips/GNS3.
coreemu simulates a wide range of network topologies with GUI tool , python script , quagga , hub , switch , PC etc.

- install coreemu

just referred to http://pf.itd.nrl.navy.mil/core/core-html/index.html

# uname –ri
3.2.0-34-generic x86_64

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:        12.04
Codename:       precise

# apt-get install bash bridge-utils ebtables iproute libev-dev libtk-img python tcl8.5 tk8.5 xterm -y


download customized quagga and install it.

install core for Ubuntu

download core
# wget http://downloads.pf.itd.nrl.navy.mil/core/packages/4.4/core_4.4-0ubuntu1_precise_amd64.deb

on GUI terminal , run the following command.
# software-center /home/user/Downloads/core_4.4-0ubuntu1_amd64.deb



start core daemon.
# /etc/init.d/core start
* Starting cored.py


run core GUI
# core



n2 sends icmp packets to n3.
n1 and n3 are router. ( quagga )
n1 is hub.





save configuration.




# cat /root/.core/configs/test.imn
node n1 {
   type hub
   network-config {
       hostname n1
       !
   }
   canvas c1
   iconcoords {226.0 116.0}
   labelcoords {226.0 140.0}
   interface-peer {e0 n2}
   interface-peer {e1 n3}
}

node n2 {
   type router
   model router
   network-config {
       hostname n2
       !
       interface eth0
        ip address 10.0.0.1/24
       !
   }
   canvas c1
   iconcoords {76.0 118.0}
   labelcoords {76.0 146.0}
   interface-peer {eth0 n1}
}

node n3 {
   type router
   model router
   network-config {
       hostname n3
       !
       interface eth0
        ip address 10.0.0.2/24
       !
   }
   canvas c1
   iconcoords {351.0 116.0}
   labelcoords {351.0 144.0}
   interface-peer {eth0 n1}
}

link l1 {
   nodes {n2 n1}
   bandwidth 0
}

link l2 {
   nodes {n1 n3}
   bandwidth 0
}

canvas c1 {
   name {Canvas1}
}

option global {
   interface_names no
   ip_addresses yes
   ipv6_addresses yes
   node_labels yes
   link_labels yes
   ipsec_configs yes
   exec_errors yes
   show_api no
   background_images no
   annotations yes
   grid yes
   traffic_start 0
}

option session {
}


- use python script.

( just referred to http://pf.itd.nrl.navy.mil/core/core-html/scripting.html )
# cat test.py
#!/usr/bin/env python

from core import pycore

session = pycore.Session(persistent=True)
node1 = session.addobj(cls=pycore.nodes.CoreNode, name="n1")
node2 = session.addobj(cls=pycore.nodes.CoreNode, name="n2")
hub1 = session.addobj(cls=pycore.nodes.HubNode, name="hub1")
node1.newnetif(hub1, ["10.0.0.1/24"])
node2.newnetif(hub1, ["10.0.0.2/24"])

node1.icmd(["ping", "-c", "5", "10.0.0.2"])
session.shutdown()


n1 ( node1 ) 10.0.0.1 --- hub1 – 10.0.0.2 n2 ( node2 )

n1 sends icmp packets to n2.
# ./test.py
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=0.043 ms
64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.087 ms
64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.030 ms
64 bytes from 10.0.0.2: icmp_req=4 ttl=64 time=0.034 ms
64 bytes from 10.0.0.2: icmp_req=5 ttl=64 time=0.037 ms

--- 10.0.0.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms
rtt min/avg/max/mdev = 0.030/0.046/0.087/0.021 ms


there are sample python scripts under /usr/share/core/examples/netns/ directory.
# ls /usr/share/core/examples/netns/
basicrange.py        switchgui.py   twonodes.sh
howmanynodes.py      switch.py      wlanemanetests.py
ospfmanetmdrtest.py  switchtest.py  wlantest.py


- sample imm

root/.core/configs/sample3-bgp.imn


send icmp packets from pc12 to host11.



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.