Installing on Ubuntu
Install git and git flow:
sudo apt-get install git git-flow
Clone Ryu:
git clone git://github.com/osrg/ryu.git
Install Python bits n' pieces:
sudo apt-get install python-setuptools python-pip libxml2-dev libxslt-dev
# Fix python-six (compatibility library) version issue:
sudo pip install six --upgrade
sudo apt-get install python-dev
Install YAML ("YAML Ain't Markup Language") for parsing config and policy files:
sudo apt-get install python-yaml
Install dpkt library:
sudo pip install dpkt
Install Ryu Prerequisites:
sudo apt-get install python-eventlet
sudo apt-get install python-routes
sudo apt-get install python-webob
sudo apt-get install python-paramiko
Install Ryu:
cd ryu
sudo python ./setup.py install
Run Ryu (simple switch) to check that it works (from ryu directory)
PYTHONPATH=. ./bin/ryu-manager --verbose ryu/app/simple_switch.py
Install nmeta
cd
git clone https://github.com/mattjhayes/nmeta.git
Run nmeta
cd
cd ryu
PYTHONPATH=. ./bin/ryu-manager ../nmeta/nmeta.py
Add Aliases (Optional)
Aliases can make it quicker and easier to run common commands. Here are a few aliases that may be useful:
Alias Command | What It Does | Raw Command |
---|---|---|
nm | Run nmeta | cd; cd ryu; PYTHONPATH=. ./bin/ryu-manager ../nmeta/nmeta.py |
nt | Run nose tests | cd; cd nmeta; nosetests -v |
yt | Check YAML compliance of tc_policy.yaml config file | python nmeta/misc/yamltest.py nmeta/config/tc_policy.yaml |
To add the aliases, edit the .bash_aliases file in your home directory:
cd
sudo vi .bash_aliases
Paste in the following:
alias nm="cd; cd ryu; PYTHONPATH=. ./bin/ryu-manager ../nmeta/nmeta.py"
alias nt="cd; cd nmeta; nosetests -v"
alias yt='python nmeta/misc/yamltest.py nmeta/config/tc_policy.yaml'
Note that these commands may change your working directory
Fix LLDP Bug (Optional)
The lldp.py packet library module supplied with Ryu has (at the time of writing) a bug related to parsing system capabilities. A modified version of this file can be copied over the original to fix this.
First back up the original lldp.py file:
cp ryu/ryu/lib/packet/lldp.py ryu/ryu/lib/packet/lldp.py.original
Now overwrite lldp.py with the modified file:
cp nmeta/lldp-fixed.py ryu/ryu/lib/packet/lldp.py