Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Friday, November 30, 2012

Routing Tutorials from RNP

A CORE user from Brazil's RNP training unit, ESR, has contributed some tutorial material developed for a course on IP routing protocols.

The PDFs cover configuration of static routes, RIP, OSPF, and BGP protocols, and include imn scenario files and some pcap traces. The material is available on the supplemental downloads page. Thanks Luiz Carlos Lobato!

Thursday, August 25, 2011

yargh, hooks

One of the goals of the CORE project is hackability. In that spirit, you can now define hooks under the experiment menu. Hooks are optional shell scripts that run at the specified session state. (If you previously used the global experiment script, this is the same thing; the experiment script now becomes a runtime hook.) The hook script runs on the host as root, is not associated with any particular node, and is saved in the imn file.
 Below the hook configuration dialog is shown. You select the session state from a drop-down menu.

Here are the session states and their meanings:
  1. Definition - used by the GUI to tell the backend to clear any state.
  2. Configuration - when the user presses the Start button, node, link, and other configuration data is sent to the backend.
  3. Instantiation - after configuration data has been sent, just before the nodes are created.
  4. Runtime - all nodes and networks have been built and are running.
  5. Datacollect - the user has pressed the Stop button; a good time to collect log files before nodes are shut down.
  6. Shutdown - all nodes and networks have been shut down and destroyed.
Another related feature that has been added is a /tmp/pycore.nnnnn/state file. As a session changes states, it will write the current state number and name into this file. This would enable an external program or script to monitor that file.

Wednesday, November 24, 2010

traffic flows using MGEN

A new Traffic Tool has been added to the Tools menu. You can use this tool to create traffic flows between source and destination nodes.
When you click to create or edit a flow, the dialog shown below appears. Clicking on the source node button allows you to choose a node that will send traffic and destination node a node that will listen and log received traffic. IP addresses are automatically entered based on selected nodes, or you can choose addresses from a list. A few preset traffic patterns are defined to help get you started using MGEN.
When the scenario is started, MGEN scripts are generated on each of the nodes. Each flow has a start (and optional stop) time. You can choose to autostart all flows after the emulation is running or manually start and stop them.

To use this feature, you should get MGEN from here. The nightly snapshot for MGEN and protolib are recommended.

Wednesday, October 6, 2010

Configs moved from /etc/core to $HOME/core

A new change in the development version of CORE (svn snapshot) is that the CORE GUI will now use a $HOME/.core directory for configuration that it writes.

  • the default scenario dir for imn files is now ~/.core/configs/
  • existing ~/.core preferences file is moved to ~/.core/prefs.conf
  • plugins.conf, servers.conf, and widgets.conf now live in ~/.core/
  • the read-only /etc/core/core.conf file still exists, for configuring the daemon (cored.py)

This fixes bug #25 (http://code.google.com/p/coreemu/issues/detail?id=25)

Wednesday, October 28, 2009

ebtables and 64-bit OpenVZ Linux kernel

CentOS 5.4 doesn't have its own ebtables package, so we use the ebtables package found in the EPEL repository. Unfortunately, when you install the x86_64 OpenVZ kernel onto your 64-bit CentOS 5.4, this ebtables (ebtables-2.0.8-1.el5.x86_64) package doesn't work:

# ebtables -N test -P DROP
The kernel doesn't support a certain ebtables extension, consider
recompiling your kernel or insmod the extension.
#

And the kernel gives us this message:

# dmesg | tail
Ebtables v2.0 registered
kernel msg: ebtables bug: please report to author: entries_size too small

If you download the latest ebtables source (ebtables-v2.0.9.tar.gz) and do a make && make install you experience the same problem. When you build with make static things appear to work somewhat, but some commands still fail.

The solution is to fall back to the year 2003 and get ebtables-v2.0.6.tar.gz. You'll need the three patches found here: 2.6.20.patch, gcc4.patch, and iets.patch.

Here is how to make it work:

> tar xzf ebtables-v2.0.6.tar.gz
> cd ebtables-v2.0.6.tar.gz
> patch -p1 < ~/2.6.20.patch
patching file include/linux/netfilter_bridge.h
> patch -p1 < ~/gcc4.patch
patching file extensions/ebt_ip.c
patching file extensions/ebt_limit.c
patching file extensions/ebt_vlan.c
> patch -p1 < ~/iets.patch
patching file ebtables.c
> make
> sudo make install

Now you'll have a working ebtables, but with 2003 syntax. This means some commands won't work, such as:
ebtables -N test -P DROP
now must be written as:
ebtables -N test; ebtables -P test DROP
or
ebtables -I FORWARD -j ACCEPT
now requires a rule number:
ebtables -I FORWARD 1 -j ACCEPT

Maybe there is a better solution out there?

Wednesday, September 23, 2009

Installing OpenVZ on Fedora 11

This describes how to install the OpenVZ virtualization kernel and software on a Fedora 11 system. Instead of using the default rhel5 stable OpenVZ kernel, we'll be using the experimental 2.6.27 OpenVZ kernel.

EXT4 Warning: the 2.6.27 OpenVZ kernel does not have support for ext4 compiled in; your life will be easier if you install Fedora 11 onto an ext3 partition rather than the default ext4.
update April 2010: OpenVZ developers have backported the ext4 driver for 2.6.27 and released 2.6.32 kernels, so this should no longer be an issue.

  1. setup the openvz.repo as described in the OpenVZ quick install instructions
  2. edit the /etc/yum.repos.d/openvz.repo file and change the [openvz-kernel-2.6.27] section to enabled=1
  3. change the [openvz-kernel-rhel5] section to enabled=0
  4. the 2.6.27 kernel is older than Fedora 11's 2.6.29 kernel, so you need to force the install using this yum plugin:
    yum install yum-allowdowngrade

  5. finally, you may install the kernel and utlilities
    yum install vzkernel --alow-downgrade
    yum install vzctl
  6. don't forget to edit /etc/grub.conf and give the kernel a sensible name, such as "OpenVZ"