Difference between revisions of "Vnx-install-fedora23"
(→Additional install steps for Dynamips support) |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 43: | Line 43: | ||
<li>Edit /etc/vnx.conf file and change the following parameters:</li> | <li>Edit /etc/vnx.conf file and change the following parameters:</li> | ||
[general] | [general] | ||
− | console_term=roxterm | + | console_term=roxterm # gnome-terminal does not support --title option |
[libvirt] | [libvirt] | ||
Line 57: | Line 57: | ||
=== Additional install steps for Dynamips support === | === Additional install steps for Dynamips support === | ||
+ | |||
+ | <ul> | ||
+ | <li>Install dynamips from GNS-3 sources:</li> | ||
+ | <pre> | ||
+ | yum -y groupinstall "Development Tools" | ||
+ | yum -y install cmake elfutils-libelf-devel libuuid-devel libpcap-devel | ||
+ | git clone https://github.com/GNS3/dynamips | ||
+ | cd dynamips | ||
+ | mkdir build | ||
+ | cd build | ||
+ | cmake | ||
+ | make | ||
+ | sudo make install | ||
+ | </pre> | ||
+ | <li>Install dynagen:</li> | ||
+ | wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm | ||
+ | rpm -i dynagen-0.11.0-1.fc9.noarch.rpm | ||
+ | <li>Create systemd startup files:</li> | ||
+ | <ul> | ||
+ | <li>/usr/lib/systemd/scripts/dynamips.sh</li> | ||
+ | <pre> | ||
+ | #! /bin/sh | ||
+ | # -*- shell-script -*- | ||
+ | |||
+ | # Script to start dynamips on Fedora | ||
+ | # Adapted for VNX (vnx.dit.upm.es) by David Fernandez (david at dit.upm.es) from http://wiki.call-cc.org/spiffy-systemd-scripts | ||
+ | |||
+ | dynamips=/usr/local/bin/dynamips | ||
+ | logfile=/var/log/dynamips.log | ||
+ | dynamips_port=7200 | ||
+ | |||
+ | DATE_FORMAT="+%Y-%m-%d %H:%M:%S" | ||
+ | |||
+ | LOG_DIR="/var/log/" | ||
+ | |||
+ | start() { | ||
+ | if [ ! -d "$LOG_DIR" ]; then | ||
+ | echo "Log directory \"$LOG_DIR\" does not exist." | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | echo "Starting dynamips..." | ||
+ | echo "start: " `date "$DATE_FORMAT"` >> $logfile | ||
+ | (/usr/local/bin/dynamips -H $dynamips_port -l $logfile &) </dev/null &> $logfile | ||
+ | } | ||
+ | |||
+ | stop() { | ||
+ | echo "Stopping dynamips..." | ||
+ | echo "stop: " `date "$DATE_FORMAT"` >> $logfile | ||
+ | pids=`ps ax | grep "$dynamips" | grep -v grep | awk '{print $1}'` | ||
+ | if [ -z "$pids" ] ; then | ||
+ | echo "dynamips is not running" | ||
+ | else | ||
+ | for pid in $pids; do | ||
+ | echo "killing " $pid | ||
+ | kill $pid | ||
+ | done | ||
+ | fi | ||
+ | } | ||
+ | case "$1" in | ||
+ | start) | ||
+ | start | ||
+ | ;; | ||
+ | stop) | ||
+ | stop | ||
+ | ;; | ||
+ | restart) | ||
+ | stop | ||
+ | sleep 1 | ||
+ | start | ||
+ | ;; | ||
+ | *) exit 1 | ||
+ | esac | ||
+ | </pre> | ||
+ | <li>/usr/lib/systemd/system/dynamips.service</li> | ||
+ | <pre> | ||
+ | [Unit] | ||
+ | Description=Dynamips | ||
+ | |||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | ExecStart=/usr/lib/systemd/scripts/dynamips.sh start | ||
+ | ExecStop=/usr/lib/systemd/scripts/dynamips.sh stop | ||
+ | RemainAfterExit=yes | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </pre> | ||
+ | </ul> | ||
+ | |||
+ | <li>Make the startup script executable and enable it:</li> | ||
+ | chmod +x /usr/lib/systemd/scripts/dynamips.sh | ||
+ | systemctl enable dynamips | ||
+ | <li>Calculate the idle-pc value for your computer:</li> | ||
+ | dynagen /usr/share/vnx/examples/R3640.net | ||
+ | console R3640 # type 'no' to exit the config wizard and wait | ||
+ | # for the router to completely start | ||
+ | idlepc get R3640 | ||
+ | Once you know the idlepc value for your system, include it in /etc/vnx.conf file. | ||
+ | </ul> |
Latest revision as of 20:49, 14 February 2016
VNX Installation over Fedora
Follow this steps to install VNX over Fedora 23:
- Install packages:
dnf install -y qemu-kvm libvirt virt-manager virt-viewer perl-XML-LibXML dnf install -y perl-Sys-Virt perl-NetAddr-IP perl-XML-LibXML perl-XML-Tidy dnf install -y perl-AppConfig perl-Readonly perl-Net-Pcap perl-Net-IPv6Addr dnf install -y perl-Net-Telnet perl-IO-Pty-Easy perl-Exception-Class pv dnf install -y wmctrl uml_utilities perl-DBI libxml2-devel perl-Net-IP dnf install -y roxterm xterm graphviz tree curl w3m picocom expect pv dnf install -y tunctl screen wget lxc lxc-extra lxc-templates openvswitch
security_driver = "none" user = "root" group = "root" cgroup_device_acl = [ "/dev/null", "/dev/full", "/dev/zero", "/dev/random", "/dev/urandom", "/dev/ptmx", "/dev/kvm", "/dev/kqemu", "/dev/rtc", "/dev/hpet", "/dev/vfio/vfio", "/dev/net/tun" ]
(you have to add "/dev/net/tun") and restart libvirtd for the changes to take effect:
sudo systemctl restart libvirtd
sudo virsh list sudo virsh capabilities
mkdir /tmp/vnx-update cd /tmp/vnx-update wget -N http://vnx.dit.upm.es/vnx/vnx-latest.tgz tar xfvz vnx-latest.tgz cd vnx-* ./install_vnx
mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
[general] console_term=roxterm # gnome-terminal does not support --title option [libvirt] one_pass_autoconf=yes [lxc] union_type = 'overlayfs' overlayfs_workdir_option = 'yes'
Additional install steps for Dynamips support
- Install dynamips from GNS-3 sources:
yum -y groupinstall "Development Tools" yum -y install cmake elfutils-libelf-devel libuuid-devel libpcap-devel git clone https://github.com/GNS3/dynamips cd dynamips mkdir build cd build cmake make sudo make install
wget http://downloads.sourceforge.net/project/dyna-gen/dynagen%20source%20_%20Linux/dynagen%200.11.0/dynagen-0.11.0-1.fc9.noarch.rpm rpm -i dynagen-0.11.0-1.fc9.noarch.rpm
- /usr/lib/systemd/scripts/dynamips.sh
#! /bin/sh # -*- shell-script -*- # Script to start dynamips on Fedora # Adapted for VNX (vnx.dit.upm.es) by David Fernandez (david at dit.upm.es) from http://wiki.call-cc.org/spiffy-systemd-scripts dynamips=/usr/local/bin/dynamips logfile=/var/log/dynamips.log dynamips_port=7200 DATE_FORMAT="+%Y-%m-%d %H:%M:%S" LOG_DIR="/var/log/" start() { if [ ! -d "$LOG_DIR" ]; then echo "Log directory \"$LOG_DIR\" does not exist." exit 1 fi echo "Starting dynamips..." echo "start: " `date "$DATE_FORMAT"` >> $logfile (/usr/local/bin/dynamips -H $dynamips_port -l $logfile &) </dev/null &> $logfile } stop() { echo "Stopping dynamips..." echo "stop: " `date "$DATE_FORMAT"` >> $logfile pids=`ps ax | grep "$dynamips" | grep -v grep | awk '{print $1}'` if [ -z "$pids" ] ; then echo "dynamips is not running" else for pid in $pids; do echo "killing " $pid kill $pid done fi } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 1 start ;; *) exit 1 esac
[Unit] Description=Dynamips [Service] Type=oneshot ExecStart=/usr/lib/systemd/scripts/dynamips.sh start ExecStop=/usr/lib/systemd/scripts/dynamips.sh stop RemainAfterExit=yes [Install] WantedBy=multi-user.target
chmod +x /usr/lib/systemd/scripts/dynamips.sh systemctl enable dynamips
dynagen /usr/share/vnx/examples/R3640.net console R3640 # type 'no' to exit the config wizard and wait # for the router to completely start idlepc get R3640
Once you know the idlepc value for your system, include it in /etc/vnx.conf file.