blob: 45ee049c122c37273976d6515ea30e8b0cb655d7 [file] [log] [blame]
Jonathan Hart6ccaec82015-04-01 14:43:40 -07001#!/bin/bash
Jonathan Hart445aa5c2015-04-02 16:34:22 -07002# sdnip-setup.sh
Jonathan Harta509f472015-04-02 16:19:47 -07003#
4# Runs as sdnip user.
5#
6# Sets up the SDN-IP tutorial.
Jonathan Hart6ccaec82015-04-01 14:43:40 -07007
8export USER=sdnip
9
10echo "Creating SDN-IP tutorial"
11
12#--------------- Copy SDNIP code to home -----
13
14cp -r /home/mininet/onos/tools/tutorials/sdnip /home/sdnip/
Jonathan Hart6b051d92015-04-01 17:04:35 -070015cp -r /home/sdnip/sdnip/configs /home/sdnip/
Jonathan Hartd2a52622015-04-01 16:46:18 -070016sudo -u mininet sh -c 'cp -r /home/sdnip/sdnip/configs/addresses.json /home/mininet/onos/tools/package/config'
17sudo -u mininet sh -c 'cp -r /home/sdnip/sdnip/configs/sdnip.json /home/mininet/onos/tools/package/config'
Jonathan Hart6ccaec82015-04-01 14:43:40 -070018
Jonathan Hartf16c1222015-04-01 19:38:49 -070019
20#--------------- Add iptables rule for BGP-ONOS communication -----
21
Jonathan Hart5cf990e2015-04-02 14:47:36 -070022echo "sudo iptables -A PREROUTING -t nat -i root-eth0 -p tcp --dport 2000 -j DNAT --to 10.0.3.11:2000 " >> /home/sdnip/.xprofile
Jonathan Hartf16c1222015-04-01 19:38:49 -070023
Jonathan Hart6ccaec82015-04-01 14:43:40 -070024DESKTOP=/home/${USER}/Desktop
25
26mkdir -p ${DESKTOP}
27
28cat > ${DESKTOP}/ONOS << EOF
29[Desktop Entry]
30Encoding=UTF-8
31Type=Application
32Name=ONOS
33Name[en_US]=ONOS
34Icon=konsole
Jonathan Hartf648acd2015-07-07 03:16:47 -070035Exec=/usr/bin/lxterminal -e '/home/mininet/apache-karaf-3.0.3/bin/client -u karaf -h 10.0.3.11'
Jonathan Hart6ccaec82015-04-01 14:43:40 -070036Comment[en_US]=
37EOF
38
39cat > "${DESKTOP}/SDN-IP Mininet" << EOF
40[Desktop Entry]
41Encoding=UTF-8
42Type=Application
43Name=SDN-IP Mininet
44Name[en_US]=SDN-IP Mininet
45Icon=konsole
46Exec=/usr/bin/lxterminal -e 'sudo mn --custom /home/sdnip/sdnip/tutorial.py --topo sdnip --controller remote,10.0.3.11 --nolistenport'
47Comment[en_US]=
48EOF
49
50cat > ${DESKTOP}/Tutorial << EOF
51[Desktop Entry]
52Encoding=UTF-8
53Type=Application
54Name=SDN-IP Tutorial
55Name[en_US]=SDN-IP Tutorial
56Icon=internet-web-browser
57Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/SDN-IP+Tutorial
58Comment[en_US]=
59EOF
60
61cat > ${DESKTOP}/GUI << EOF
62[Desktop Entry]
63Encoding=UTF-8
64Type=Application
65Name=ONOS GUI
66Name[en_US]=ONOS GUI
67Icon=internet-web-browser
68Exec=/usr/bin/chromium-browser http://10.0.3.11:8181/onos/ui/index.html#topo
69Comment[en_US]=
70EOF
71
72cat > ${DESKTOP}/Wireshark << EOF
73[Desktop Entry]
74Encoding=UTF-8
75Type=Application
76Name=Wireshark
77Name[en_US]=Wireshark
78Icon=wireshark
79Exec=/usr/bin/wireshark
80Comment[en_US]=
81EOF
82
83cat > ${DESKTOP}/Reset << EOF
84[Desktop Entry]
85Encoding=UTF-8
86Type=Application
87Name=Reset
88Name[en_US]=Reset
89Icon=konsole
90Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c /home/mininet/reset-to-1.sh'
91Comment[en_US]=
92EOF