Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pim_dm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
pim_dm
Commits
493fe38d
Commit
493fe38d
authored
Nov 14, 2017
by
Pedro Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test neighbors
parent
a11b869c
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
41 additions
and
919 deletions
+41
-919
emulation/client1.startup
emulation/client1.startup
+0
-10
emulation/client1/etc/resolv.conf
emulation/client1/etc/resolv.conf
+0
-2
emulation/client1/root/client.py
emulation/client1/root/client.py
+0
-62
emulation/client1/root/server.py
emulation/client1/root/server.py
+0
-57
emulation/client2.startup
emulation/client2.startup
+0
-10
emulation/client2/etc/resolv.conf
emulation/client2/etc/resolv.conf
+0
-2
emulation/client2/root/client.py
emulation/client2/root/client.py
+0
-62
emulation/client2/root/server.py
emulation/client2/root/server.py
+0
-57
emulation/client3.startup
emulation/client3.startup
+0
-10
emulation/client3/etc/resolv.conf
emulation/client3/etc/resolv.conf
+0
-2
emulation/client3/root/client.py
emulation/client3/root/client.py
+0
-62
emulation/client3/root/server.py
emulation/client3/root/server.py
+0
-57
emulation/lab.conf
emulation/lab.conf
+9
-26
emulation/lab.dep
emulation/lab.dep
+4
-7
emulation/router1.startup
emulation/router1.startup
+1
-6
emulation/router1/etc/quagga/daemons
emulation/router1/etc/quagga/daemons
+0
-31
emulation/router1/etc/quagga/debian.conf
emulation/router1/etc/quagga/debian.conf
+0
-24
emulation/router1/etc/quagga/ospfd.conf
emulation/router1/etc/quagga/ospfd.conf
+0
-16
emulation/router1/etc/quagga/vtysh.conf
emulation/router1/etc/quagga/vtysh.conf
+0
-7
emulation/router1/etc/quagga/zebra.conf
emulation/router1/etc/quagga/zebra.conf
+0
-25
emulation/router1/root/script.sh
emulation/router1/root/script.sh
+2
-10
emulation/router2.startup
emulation/router2.startup
+1
-15
emulation/router2/etc/quagga/daemons
emulation/router2/etc/quagga/daemons
+0
-31
emulation/router2/etc/quagga/debian.conf
emulation/router2/etc/quagga/debian.conf
+0
-24
emulation/router2/etc/quagga/ospfd.conf
emulation/router2/etc/quagga/ospfd.conf
+0
-15
emulation/router2/etc/quagga/vtysh.conf
emulation/router2/etc/quagga/vtysh.conf
+0
-7
emulation/router2/etc/quagga/zebra.conf
emulation/router2/etc/quagga/zebra.conf
+0
-25
emulation/router2/root/script.sh
emulation/router2/root/script.sh
+2
-10
emulation/router3.startup
emulation/router3.startup
+2
-14
emulation/router3/etc/quagga/daemons
emulation/router3/etc/quagga/daemons
+0
-31
emulation/router3/etc/quagga/debian.conf
emulation/router3/etc/quagga/debian.conf
+0
-24
emulation/router3/etc/quagga/ospfd.conf
emulation/router3/etc/quagga/ospfd.conf
+0
-14
emulation/router3/etc/quagga/vtysh.conf
emulation/router3/etc/quagga/vtysh.conf
+0
-7
emulation/router3/etc/quagga/zebra.conf
emulation/router3/etc/quagga/zebra.conf
+0
-25
emulation/router3/root/script.sh
emulation/router3/root/script.sh
+2
-8
emulation/router4.startup
emulation/router4.startup
+2
-15
emulation/router4/etc/quagga/daemons
emulation/router4/etc/quagga/daemons
+0
-31
emulation/router4/etc/quagga/debian.conf
emulation/router4/etc/quagga/debian.conf
+0
-24
emulation/router4/etc/quagga/ospfd.conf
emulation/router4/etc/quagga/ospfd.conf
+0
-14
emulation/router4/etc/quagga/vtysh.conf
emulation/router4/etc/quagga/vtysh.conf
+0
-7
emulation/router4/etc/quagga/zebra.conf
emulation/router4/etc/quagga/zebra.conf
+0
-25
emulation/router4/root/script.sh
emulation/router4/root/script.sh
+2
-8
emulation/switch1.startup
emulation/switch1.startup
+8
-0
emulation/switch1/root/script.sh
emulation/switch1/root/script.sh
+6
-0
No files found.
emulation/client1.startup
deleted
100644 → 0
View file @
a11b869c
ip addr add dev eth0 10.1.0.1/24
ip link set dev eth0 up
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.1.0.2
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
pip-3.2 install netifaces
emulation/client1/etc/resolv.conf
deleted
100644 → 0
View file @
a11b869c
nameserver
8
.
8
.
8
.
8
nameserver
8
.
8
.
4
.
4
emulation/client1/root/client.py
deleted
100644 → 0
View file @
a11b869c
import
socket
import
struct
import
sys
import
netifaces
def
chooseInterface
():
interfaces
=
netifaces
.
interfaces
()
def
printInterfaces
():
print
(
'Indique a interface de captura:'
)
for
i
in
range
(
len
(
interfaces
)):
print
(
i
+
1
,
'-'
,
interfaces
[
i
])
if
len
(
interfaces
)
==
1
:
#user has just 1 interface and any
return
interfaces
[
0
]
else
:
printInterfaces
()
inputValue
=
input
(
'Numero da interface: '
)
if
int
(
inputValue
)
-
1
not
in
range
(
len
(
interfaces
)):
raise
Exception
(
'numero de interface invalida'
)
inputValue
=
interfaces
[
int
(
inputValue
)
-
1
]
return
inputValue
if
not
hasattr
(
socket
,
'SO_BINDTODEVICE'
):
socket
.
SO_BINDTODEVICE
=
25
multicast_group
=
'224.12.12.12'
server_address
=
(
''
,
10000
)
# Create the socket
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
# Bind to the server address
sock
.
bind
(
server_address
)
#interface_name = input("interface name: ")
interface_name
=
chooseInterface
()
ip_interface
=
netifaces
.
ifaddresses
(
interface_name
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
# Tell the operating system to add the socket to the multicast group
# on all interfaces.
group
=
socket
.
inet_aton
(
multicast_group
)
sock
.
setsockopt
(
socket
.
IPPROTO_IP
,
socket
.
IP_ADD_MEMBERSHIP
,
socket
.
inet_aton
(
multicast_group
)
+
socket
.
inet_aton
(
ip_interface
))
#sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, str(interface_name + "\0").encode('utf-8'))
# Receive/respond loop
while
True
:
#print >>sys.stderr, '\nwaiting to receive message'
data
,
address
=
sock
.
recvfrom
(
10240
)
print
(
data
.
decode
(
"utf-8"
))
#print >>sys.stderr, 'received %s bytes from %s' % (len(data), address)
#print >>sys.stderr, data
#print >>sys.stderr, 'sending acknowledgement to', address
#sock.sendto('ack', address)
emulation/client1/root/server.py
deleted
100644 → 0
View file @
a11b869c
import
socket
import
struct
import
sys
import
netifaces
import
traceback
def
chooseInterface
():
interfaces
=
netifaces
.
interfaces
()
def
printInterfaces
():
print
(
'Indique a interface de captura:'
)
for
i
in
range
(
len
(
interfaces
)):
print
(
i
+
1
,
'-'
,
interfaces
[
i
])
if
len
(
interfaces
)
==
1
:
#user has just 1 interface and any
return
interfaces
[
0
]
else
:
printInterfaces
()
inputValue
=
input
(
'Numero da interface: '
)
if
int
(
inputValue
)
-
1
not
in
range
(
len
(
interfaces
)):
raise
Exception
(
'numero de interface invalida'
)
inputValue
=
interfaces
[
int
(
inputValue
)
-
1
]
return
inputValue
#message = 'very important data'
multicast_group
=
(
'224.12.12.12'
,
10000
)
# Create the datagram socket
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
# Set the time-to-live for messages to 1 so they do not go past the
# local network segment.
ttl
=
struct
.
pack
(
'b'
,
12
)
sock
.
setsockopt
(
socket
.
IPPROTO_IP
,
socket
.
IP_MULTICAST_TTL
,
ttl
)
interface_name
=
chooseInterface
()
ip_interface
=
netifaces
.
ifaddresses
(
interface_name
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
sock
.
bind
((
ip_interface
,
10000
))
try
:
# Look for responses from all recipients
while
True
:
input_msg
=
input
(
'msg --> '
)
try
:
sock
.
sendto
(
input_msg
.
encode
(
"utf-8"
),
multicast_group
)
except
:
traceback
.
print_exc
()
continue
#print >>sys.stderr, 'received "%s" from %s' % (data, server)
finally
:
#print >>sys.stderr, 'closing socket'
sock
.
close
()
emulation/client2.startup
deleted
100644 → 0
View file @
a11b869c
ip addr add dev eth0 10.0.2.10/24
ip link set dev eth0 up
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.0.2.3
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
pip-3.2 install netifaces
emulation/client2/etc/resolv.conf
deleted
100644 → 0
View file @
a11b869c
nameserver
8
.
8
.
8
.
8
nameserver
8
.
8
.
4
.
4
emulation/client2/root/client.py
deleted
100644 → 0
View file @
a11b869c
import
socket
import
struct
import
sys
import
netifaces
def
chooseInterface
():
interfaces
=
netifaces
.
interfaces
()
def
printInterfaces
():
print
(
'Indique a interface de captura:'
)
for
i
in
range
(
len
(
interfaces
)):
print
(
i
+
1
,
'-'
,
interfaces
[
i
])
if
len
(
interfaces
)
==
1
:
#user has just 1 interface and any
return
interfaces
[
0
]
else
:
printInterfaces
()
inputValue
=
input
(
'Numero da interface: '
)
if
int
(
inputValue
)
-
1
not
in
range
(
len
(
interfaces
)):
raise
Exception
(
'numero de interface invalida'
)
inputValue
=
interfaces
[
int
(
inputValue
)
-
1
]
return
inputValue
if
not
hasattr
(
socket
,
'SO_BINDTODEVICE'
):
socket
.
SO_BINDTODEVICE
=
25
multicast_group
=
'224.12.12.12'
server_address
=
(
''
,
10000
)
# Create the socket
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
# Bind to the server address
sock
.
bind
(
server_address
)
#interface_name = input("interface name: ")
interface_name
=
chooseInterface
()
ip_interface
=
netifaces
.
ifaddresses
(
interface_name
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
# Tell the operating system to add the socket to the multicast group
# on all interfaces.
group
=
socket
.
inet_aton
(
multicast_group
)
sock
.
setsockopt
(
socket
.
IPPROTO_IP
,
socket
.
IP_ADD_MEMBERSHIP
,
socket
.
inet_aton
(
multicast_group
)
+
socket
.
inet_aton
(
ip_interface
))
#sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, str(interface_name + "\0").encode('utf-8'))
# Receive/respond loop
while
True
:
#print >>sys.stderr, '\nwaiting to receive message'
data
,
address
=
sock
.
recvfrom
(
10240
)
print
(
data
.
decode
(
"utf-8"
))
#print >>sys.stderr, 'received %s bytes from %s' % (len(data), address)
#print >>sys.stderr, data
#print >>sys.stderr, 'sending acknowledgement to', address
#sock.sendto('ack', address)
emulation/client2/root/server.py
deleted
100644 → 0
View file @
a11b869c
import
socket
import
struct
import
sys
import
netifaces
import
traceback
def
chooseInterface
():
interfaces
=
netifaces
.
interfaces
()
def
printInterfaces
():
print
(
'Indique a interface de captura:'
)
for
i
in
range
(
len
(
interfaces
)):
print
(
i
+
1
,
'-'
,
interfaces
[
i
])
if
len
(
interfaces
)
==
1
:
#user has just 1 interface and any
return
interfaces
[
0
]
else
:
printInterfaces
()
inputValue
=
input
(
'Numero da interface: '
)
if
int
(
inputValue
)
-
1
not
in
range
(
len
(
interfaces
)):
raise
Exception
(
'numero de interface invalida'
)
inputValue
=
interfaces
[
int
(
inputValue
)
-
1
]
return
inputValue
#message = 'very important data'
multicast_group
=
(
'224.12.12.12'
,
10000
)
# Create the datagram socket
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
# Set the time-to-live for messages to 1 so they do not go past the
# local network segment.
ttl
=
struct
.
pack
(
'b'
,
12
)
sock
.
setsockopt
(
socket
.
IPPROTO_IP
,
socket
.
IP_MULTICAST_TTL
,
ttl
)
interface_name
=
chooseInterface
()
ip_interface
=
netifaces
.
ifaddresses
(
interface_name
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
sock
.
bind
((
ip_interface
,
10000
))
try
:
# Look for responses from all recipients
while
True
:
input_msg
=
input
(
'msg --> '
)
try
:
sock
.
sendto
(
input_msg
.
encode
(
"utf-8"
),
multicast_group
)
except
:
traceback
.
print_exc
()
continue
#print >>sys.stderr, 'received "%s" from %s' % (data, server)
finally
:
#print >>sys.stderr, 'closing socket'
sock
.
close
()
emulation/client3.startup
deleted
100644 → 0
View file @
a11b869c
ip addr add dev eth0 10.0.3.10/24
ip link set dev eth0 up
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.0.3.4
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
pip-3.2 install netifaces
emulation/client3/etc/resolv.conf
deleted
100644 → 0
View file @
a11b869c
nameserver
8
.
8
.
8
.
8
nameserver
8
.
8
.
4
.
4
emulation/client3/root/client.py
deleted
100644 → 0
View file @
a11b869c
import
socket
import
struct
import
sys
import
netifaces
def
chooseInterface
():
interfaces
=
netifaces
.
interfaces
()
def
printInterfaces
():
print
(
'Indique a interface de captura:'
)
for
i
in
range
(
len
(
interfaces
)):
print
(
i
+
1
,
'-'
,
interfaces
[
i
])
if
len
(
interfaces
)
==
1
:
#user has just 1 interface and any
return
interfaces
[
0
]
else
:
printInterfaces
()
inputValue
=
input
(
'Numero da interface: '
)
if
int
(
inputValue
)
-
1
not
in
range
(
len
(
interfaces
)):
raise
Exception
(
'numero de interface invalida'
)
inputValue
=
interfaces
[
int
(
inputValue
)
-
1
]
return
inputValue
if
not
hasattr
(
socket
,
'SO_BINDTODEVICE'
):
socket
.
SO_BINDTODEVICE
=
25
multicast_group
=
'224.12.12.12'
server_address
=
(
''
,
10000
)
# Create the socket
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
# Bind to the server address
sock
.
bind
(
server_address
)
#interface_name = input("interface name: ")
interface_name
=
chooseInterface
()
ip_interface
=
netifaces
.
ifaddresses
(
interface_name
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
# Tell the operating system to add the socket to the multicast group
# on all interfaces.
group
=
socket
.
inet_aton
(
multicast_group
)
sock
.
setsockopt
(
socket
.
IPPROTO_IP
,
socket
.
IP_ADD_MEMBERSHIP
,
socket
.
inet_aton
(
multicast_group
)
+
socket
.
inet_aton
(
ip_interface
))
#sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, str(interface_name + "\0").encode('utf-8'))
# Receive/respond loop
while
True
:
#print >>sys.stderr, '\nwaiting to receive message'
data
,
address
=
sock
.
recvfrom
(
10240
)
print
(
data
.
decode
(
"utf-8"
))
#print >>sys.stderr, 'received %s bytes from %s' % (len(data), address)
#print >>sys.stderr, data
#print >>sys.stderr, 'sending acknowledgement to', address
#sock.sendto('ack', address)
emulation/client3/root/server.py
deleted
100644 → 0
View file @
a11b869c
import
socket
import
struct
import
sys
import
netifaces
import
traceback
def
chooseInterface
():
interfaces
=
netifaces
.
interfaces
()
def
printInterfaces
():
print
(
'Indique a interface de captura:'
)
for
i
in
range
(
len
(
interfaces
)):
print
(
i
+
1
,
'-'
,
interfaces
[
i
])
if
len
(
interfaces
)
==
1
:
#user has just 1 interface and any
return
interfaces
[
0
]
else
:
printInterfaces
()
inputValue
=
input
(
'Numero da interface: '
)
if
int
(
inputValue
)
-
1
not
in
range
(
len
(
interfaces
)):
raise
Exception
(
'numero de interface invalida'
)
inputValue
=
interfaces
[
int
(
inputValue
)
-
1
]
return
inputValue
#message = 'very important data'
multicast_group
=
(
'224.12.12.12'
,
10000
)
# Create the datagram socket
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
# Set the time-to-live for messages to 1 so they do not go past the
# local network segment.
ttl
=
struct
.
pack
(
'b'
,
12
)
sock
.
setsockopt
(
socket
.
IPPROTO_IP
,
socket
.
IP_MULTICAST_TTL
,
ttl
)
interface_name
=
chooseInterface
()
ip_interface
=
netifaces
.
ifaddresses
(
interface_name
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
sock
.
bind
((
ip_interface
,
10000
))
try
:
# Look for responses from all recipients
while
True
:
input_msg
=
input
(
'msg --> '
)
try
:
sock
.
sendto
(
input_msg
.
encode
(
"utf-8"
),
multicast_group
)
except
:
traceback
.
print_exc
()
continue
#print >>sys.stderr, 'received "%s" from %s' % (data, server)
finally
:
#print >>sys.stderr, 'closing socket'
sock
.
close
()
emulation/lab.conf
View file @
493fe38d
...
...
@@ -2,41 +2,24 @@
# Router setup
#########################################
router1
[
0
]=
A
router1
[
1
]=
B
router1
[
2
]=
tap
,
192
.
168
.
2
.
1
,
192
.
168
.
2
.
2
router1
[
1
]=
tap
,
192
.
168
.
2
.
1
,
192
.
168
.
2
.
2
router1
[
mem
]=
256
router2
[
0
]=
A
router2
[
1
]=
C
router2
[
2
]=
F
router2
[
0
]=
B
router2
[
mem
]=
256
router3
[
0
]=
B
router3
[
1
]=
D
router3
[
0
]=
C
router3
[
mem
]=
256
router4
[
0
]=
G
router4
[
1
]=
H
router4
[
0
]=
D
router4
[
mem
]=
256
#########################################
# Switch setup
#########################################
switch1
[
0
]=
C
switch1
[
1
]=
D
switch1
[
2
]=
E
switch1
[
3
]=
G
#########################################
# Client setup
#########################################
client1
[
0
]=
F
client1
[
mem
]=
256
client2
[
0
]=
E
client2
[
mem
]=
256
client3
[
0
]=
H
client3
[
mem
]=
256
switch1
[
0
]=
A
switch1
[
1
]=
B
switch1
[
2
]=
C
switch1
[
3
]=
D
switch1
[
mem
]=
256
emulation/lab.dep
View file @
493fe38d
router2: router1 switch1
router3: router1
router4: switch1 router2 router3
client1: router2
client2: switch1 router2 router3
client3: router4
switch1: router1
router2: switch1 router1
router3: switch1 router1
router4: switch1 router1
emulation/router1.startup
View file @
493fe38d
ip addr add dev eth0 10.0.0.1/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.1.1/24
ip link set dev eth1 up
#NAT for private ip's
iptables -t nat -A POSTROUTING -s 0.0.0.0/0 -o eth2 -j MASQUERADE
# Zebra and OSPF
/etc/init.d/quagga restart
iptables -t nat -A POSTROUTING -s 0.0.0.0/0 -o eth1 -j MASQUERADE
apt-get update && apt-get --assume-yes install python3 python3-pip
...
...
emulation/router1/etc/quagga/daemons
deleted
100644 → 0
View file @
a11b869c
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
# The watchquagga daemon is always started. Per default in monitoring-only but
# that can be changed via /etc/quagga/debian.conf.
#
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no
emulation/router1/etc/quagga/debian.conf
deleted
100644 → 0
View file @
a11b869c
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable
=
yes
zebra_options
=
" --daemon -A 127.0.0.1"
bgpd_options
=
" --daemon -A 127.0.0.1"
ospfd_options
=
" --daemon -A 127.0.0.1"
ospf6d_options
=
" --daemon -A ::1"
ripd_options
=
" --daemon -A 127.0.0.1"
ripngd_options
=
" --daemon -A ::1"
isisd_options
=
" --daemon -A 127.0.0.1"
babeld_options
=
" --daemon -A 127.0.0.1"
#
# Please note that watchquagga_options is an array and not a string so that
# quotes can be used.
#
# The list of daemons to watch is automatically generated by the init script
# from daemons.conf and appended to the watchquagga_options.
# Example:
# watchquagga_options=("-Adz" "-r" '/sbin/service %s restart' -s '/sbin/service %s start' -k '/sbin/service %s stop')
watchquagga_enable
=
yes
watchquagga_options
=(--
daemon
)
emulation/router1/etc/quagga/ospfd.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
ospf
-*-
!
!
OSPFd
sample
configuration
file
!
!
hostname
ospfd
password
zebra
!
enable
password
please
-
set
-
at
-
here
!
router
ospf
network
10
.
0
.
0
.
0
/
24
area
0
network
10
.
0
.
1
.
0
/
24
area
0
network
192
.
168
.
2
.
0
/
24
area
0
default
-
information
originate
always
!
log
stdout
emulation/router1/etc/quagga/vtysh.conf
deleted
100644 → 0
View file @
a11b869c
!
!
Sample
configuration
file
for
vtysh
.
!
!
service
integrated
-
vtysh
-
config
hostname
quagga
-
router
username
root
nopassword
!
emulation/router1/etc/quagga/zebra.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
zebra
-*-
!
!
zebra
sample
configuration
file
!
! $
Id
:
zebra
.
conf
.
sample
,
v
1
.
1
2002
/
12
/
13
20
:
15
:
30
paul
Exp
$
!
hostname
Router
password
zebra
enable
password
zebra
!
!
Interface
'
s
description
.
!
!
interface
lo
!
description
test
of
desc
.
!
!
interface
sit0
!
multicast
!
!
Static
default
route
sample
.
!
ip
route
0
.
0
.
0
.
0
/
0
192
.
168
.
2
.
2
!
!
log
file
/
var
/
log
/
quagga
/
zebra
.
log
emulation/router1/root/script.sh
View file @
493fe38d
rm
-rf
MulticastRouting/
cp
-rf
/hosthome/Desktop/pim/ MulticastRouting/
cd
MulticastRouting
pip-3.2
install
-r
requirements.txt
pip-3.2
install
-
-index-url
=
https://pypi.python.org/simple/
-
r
requirements.txt
python3 Run.py
-stop
python3 Run.py
-start
python3 Run.py
-aiigmp
eth0
python3 Run.py
-aiigmp
eth1
python3 Run.py
-aiigmp
eth2
python3 Run.py
-ai
eth0
python3 Run.py
-ai
eth1
python3 Run.py
-ai
eth2
python3 Run.py
-v
python3 Server.py
emulation/router2.startup
View file @
493fe38d
ip addr add dev eth0 10.0.0.2/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.2.2/24
ip link set dev eth1 up
ip addr add dev eth2 10.1.0.2/24
ip link set dev eth2 up
#default route para obter conectividade internet
#ip route add 0.0.0.0/0 via 10.0.0.1
#ip route del 0.0.0.0/0
ip route add 0.0.0.0/0 via 10.0.0.1
# Zebra and OSPF
/etc/init.d/quagga restart
# wait for default route information from OSPF
while ! $(ip route | grep -q "default")
do
sleep 2
done
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
emulation/router2/etc/quagga/daemons
deleted
100644 → 0
View file @
a11b869c
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
# The watchquagga daemon is always started. Per default in monitoring-only but
# that can be changed via /etc/quagga/debian.conf.
#
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no
emulation/router2/etc/quagga/debian.conf
deleted
100644 → 0
View file @
a11b869c
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable
=
yes
zebra_options
=
" --daemon -A 127.0.0.1"
bgpd_options
=
" --daemon -A 127.0.0.1"
ospfd_options
=
" --daemon -A 127.0.0.1"
ospf6d_options
=
" --daemon -A ::1"
ripd_options
=
" --daemon -A 127.0.0.1"
ripngd_options
=
" --daemon -A ::1"
isisd_options
=
" --daemon -A 127.0.0.1"
babeld_options
=
" --daemon -A 127.0.0.1"
#
# Please note that watchquagga_options is an array and not a string so that
# quotes can be used.
#
# The list of daemons to watch is automatically generated by the init script
# from daemons.conf and appended to the watchquagga_options.
# Example:
# watchquagga_options=("-Adz" "-r" '/sbin/service %s restart' -s '/sbin/service %s start' -k '/sbin/service %s stop')
watchquagga_enable
=
yes
watchquagga_options
=(--
daemon
)
emulation/router2/etc/quagga/ospfd.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
ospf
-*-
!
!
OSPFd
sample
configuration
file
!
!
hostname
ospfd
password
zebra
!
enable
password
please
-
set
-
at
-
here
!
router
ospf
network
10
.
0
.
0
.
0
/
24
area
0
network
10
.
0
.
2
.
0
/
24
area
0
network
10
.
1
.
0
.
0
/
24
area
0
!
log
stdout
emulation/router2/etc/quagga/vtysh.conf
deleted
100644 → 0
View file @
a11b869c
!
!
Sample
configuration
file
for
vtysh
.
!
!
service
integrated
-
vtysh
-
config
hostname
quagga
-
router
username
root
nopassword
!
emulation/router2/etc/quagga/zebra.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
zebra
-*-
!
!
zebra
sample
configuration
file
!
! $
Id
:
zebra
.
conf
.
sample
,
v
1
.
1
2002
/
12
/
13
20
:
15
:
30
paul
Exp
$
!
hostname
Router
password
zebra
enable
password
zebra
!
!
Interface
'
s
description
.
!
!
interface
lo
!
description
test
of
desc
.
!
!
interface
sit0
!
multicast
!
!
Static
default
route
sample
.
!
!
ip
route
0
.
0
.
0
.
0
/
0
203
.
181
.
89
.
241
!
!
log
file
/
var
/
log
/
quagga
/
zebra
.
log
emulation/router2/root/script.sh
View file @
493fe38d
rm
-rf
MulticastRouting/
cp
-rf
/hosthome/Desktop/pim/ MulticastRouting/
cd
MulticastRouting
pip-3.2
install
-r
requirements.txt
pip-3.2
install
-
-index-url
=
https://pypi.python.org/simple/
-
r
requirements.txt
python3 Run.py
-stop
python3 Run.py
-start
python3 Run.py
-aiigmp
eth0
python3 Run.py
-aiigmp
eth1
python3 Run.py
-aiigmp
eth2
python3 Run.py
-ai
eth0
python3 Run.py
-ai
eth1
python3 Run.py
-ai
eth2
python3 Run.py
-v
python3 Server.py
emulation/router3.startup
View file @
493fe38d
ip addr add dev eth0 10.0.
1
.3/24
ip addr add dev eth0 10.0.
0
.3/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.2.3/24
ip link set dev eth1 up
#default route para obter conectividade internet
#ip route add 0.0.0.0/0 via 10.0.1.1
#ip route del 0.0.0.0/0
ip route add 0.0.0.0/0 via 10.0.0.1
# Zebra and OSPF
/etc/init.d/quagga restart
# wait for default route information from OSPF
while ! $(ip route | grep -q "default")
do
sleep 2
done
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
emulation/router3/etc/quagga/daemons
deleted
100644 → 0
View file @
a11b869c
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
# The watchquagga daemon is always started. Per default in monitoring-only but
# that can be changed via /etc/quagga/debian.conf.
#
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no
emulation/router3/etc/quagga/debian.conf
deleted
100644 → 0
View file @
a11b869c
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable
=
yes
zebra_options
=
" --daemon -A 127.0.0.1"
bgpd_options
=
" --daemon -A 127.0.0.1"
ospfd_options
=
" --daemon -A 127.0.0.1"
ospf6d_options
=
" --daemon -A ::1"
ripd_options
=
" --daemon -A 127.0.0.1"
ripngd_options
=
" --daemon -A ::1"
isisd_options
=
" --daemon -A 127.0.0.1"
babeld_options
=
" --daemon -A 127.0.0.1"
#
# Please note that watchquagga_options is an array and not a string so that
# quotes can be used.
#
# The list of daemons to watch is automatically generated by the init script
# from daemons.conf and appended to the watchquagga_options.
# Example:
# watchquagga_options=("-Adz" "-r" '/sbin/service %s restart' -s '/sbin/service %s start' -k '/sbin/service %s stop')
watchquagga_enable
=
yes
watchquagga_options
=(--
daemon
)
emulation/router3/etc/quagga/ospfd.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
ospf
-*-
!
!
OSPFd
sample
configuration
file
!
!
hostname
ospfd
password
zebra
!
enable
password
please
-
set
-
at
-
here
!
router
ospf
network
10
.
0
.
1
.
0
/
24
area
0
network
10
.
0
.
2
.
0
/
24
area
0
!
log
stdout
emulation/router3/etc/quagga/vtysh.conf
deleted
100644 → 0
View file @
a11b869c
!
!
Sample
configuration
file
for
vtysh
.
!
!
service
integrated
-
vtysh
-
config
hostname
quagga
-
router
username
root
nopassword
!
emulation/router3/etc/quagga/zebra.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
zebra
-*-
!
!
zebra
sample
configuration
file
!
! $
Id
:
zebra
.
conf
.
sample
,
v
1
.
1
2002
/
12
/
13
20
:
15
:
30
paul
Exp
$
!
hostname
Router
password
zebra
enable
password
zebra
!
!
Interface
'
s
description
.
!
!
interface
lo
!
description
test
of
desc
.
!
!
interface
sit0
!
multicast
!
!
Static
default
route
sample
.
!
!
ip
route
0
.
0
.
0
.
0
/
0
203
.
181
.
89
.
241
!
!
log
file
/
var
/
log
/
quagga
/
zebra
.
log
emulation/router3/root/script.sh
View file @
493fe38d
rm
-rf
MulticastRouting/
cp
-rf
/hosthome/Desktop/pim/ MulticastRouting/
cd
MulticastRouting
pip-3.2
install
-r
requirements.txt
pip-3.2
install
-
-index-url
=
https://pypi.python.org/simple/
-
r
requirements.txt
python3 Run.py
-stop
python3 Run.py
-start
python3 Run.py
-aiigmp
eth0
python3 Run.py
-aiigmp
eth1
python3 Run.py
-ai
eth0
python3 Run.py
-ai
eth1
python3 Run.py
-v
python3 Server.py
emulation/router4.startup
View file @
493fe38d
ip addr add dev eth0 10.0.
2
.4/24
ip addr add dev eth0 10.0.
0
.4/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.3.4/24
ip link set dev eth1 up
#default route para obter conectividade internet
#ip route add 0.0.0.0/0 via 10.0.1.1
#ip route del 0.0.0.0/0
# Zebra and OSPF
/etc/init.d/quagga restart
# wait for default route information from OSPF
while ! $(ip route | grep -q "default")
do
sleep 2
done
ip route add 0.0.0.0/0 via 10.0.0.1
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
...
...
emulation/router4/etc/quagga/daemons
deleted
100644 → 0
View file @
a11b869c
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
# The watchquagga daemon is always started. Per default in monitoring-only but
# that can be changed via /etc/quagga/debian.conf.
#
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no
emulation/router4/etc/quagga/debian.conf
deleted
100644 → 0
View file @
a11b869c
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable
=
yes
zebra_options
=
" --daemon -A 127.0.0.1"
bgpd_options
=
" --daemon -A 127.0.0.1"
ospfd_options
=
" --daemon -A 127.0.0.1"
ospf6d_options
=
" --daemon -A ::1"
ripd_options
=
" --daemon -A 127.0.0.1"
ripngd_options
=
" --daemon -A ::1"
isisd_options
=
" --daemon -A 127.0.0.1"
babeld_options
=
" --daemon -A 127.0.0.1"
#
# Please note that watchquagga_options is an array and not a string so that
# quotes can be used.
#
# The list of daemons to watch is automatically generated by the init script
# from daemons.conf and appended to the watchquagga_options.
# Example:
# watchquagga_options=("-Adz" "-r" '/sbin/service %s restart' -s '/sbin/service %s start' -k '/sbin/service %s stop')
watchquagga_enable
=
yes
watchquagga_options
=(--
daemon
)
emulation/router4/etc/quagga/ospfd.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
ospf
-*-
!
!
OSPFd
sample
configuration
file
!
!
hostname
ospfd
password
zebra
!
enable
password
please
-
set
-
at
-
here
!
router
ospf
network
10
.
0
.
2
.
0
/
24
area
0
network
10
.
0
.
3
.
0
/
24
area
0
!
log
stdout
emulation/router4/etc/quagga/vtysh.conf
deleted
100644 → 0
View file @
a11b869c
!
!
Sample
configuration
file
for
vtysh
.
!
!
service
integrated
-
vtysh
-
config
hostname
quagga
-
router
username
root
nopassword
!
emulation/router4/etc/quagga/zebra.conf
deleted
100644 → 0
View file @
a11b869c
! -*-
zebra
-*-
!
!
zebra
sample
configuration
file
!
! $
Id
:
zebra
.
conf
.
sample
,
v
1
.
1
2002
/
12
/
13
20
:
15
:
30
paul
Exp
$
!
hostname
Router
password
zebra
enable
password
zebra
!
!
Interface
'
s
description
.
!
!
interface
lo
!
description
test
of
desc
.
!
!
interface
sit0
!
multicast
!
!
Static
default
route
sample
.
!
!
ip
route
0
.
0
.
0
.
0
/
0
203
.
181
.
89
.
241
!
!
log
file
/
var
/
log
/
quagga
/
zebra
.
log
emulation/router4/root/script.sh
View file @
493fe38d
rm
-rf
MulticastRouting/
cp
-rf
/hosthome/Desktop/pim/ MulticastRouting/
cd
MulticastRouting
pip-3.2
install
-r
requirements.txt
pip-3.2
install
-
-index-url
=
https://pypi.python.org/simple/
-
r
requirements.txt
python3 Run.py
-stop
python3 Run.py
-start
python3 Run.py
-aiigmp
eth0
python3 Run.py
-aiigmp
eth1
python3 Run.py
-ai
eth0
python3 Run.py
-ai
eth1
python3 Run.py
-v
python3 Server.py
emulation/switch1.startup
View file @
493fe38d
...
...
@@ -8,9 +8,17 @@ brctl addif br0 eth1
brctl addif br0 eth2
brctl addif br0 eth3
ip link set dev br0 up
ip addr add dev br0 10.0.0.5/24
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.0.0.1
# install python
apt-get update && apt-get --assume-yes install python3 python3-pip
# identify ports with routers (they need to receive all multicast traffic!)
echo "2" > /sys/devices/virtual/net/br0/brif/eth0/multicast_router
echo "2" > /sys/devices/virtual/net/br0/brif/eth1/multicast_router
echo "2" > /sys/devices/virtual/net/br0/brif/eth2/multicast_router
echo "2" > /sys/devices/virtual/net/br0/brif/eth3/multicast_router
emulation/switch1/root/script.sh
0 → 100644
View file @
493fe38d
rm
-rf
test
/
cp
-rf
/hosthome/PycharmProjects/RPC/
test
/
cd test
pip-3.2
install
--index-url
=
https://pypi.python.org/simple/
-r
requirements.txt
python3 Client.py
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment