BGP hijack demo conf files

This commit is contained in:
Wojciech Kozlowski 2019-04-15 22:45:43 +02:00
parent b6aa9a4447
commit ee4a4fe684
35 changed files with 626 additions and 0 deletions

View File

@ -0,0 +1,62 @@
# Line of three and rogue router topology
```
------ ------ ------
| | | | | |
| R1 4|------|4 R2 5|------|4 R3 |
| 5 | | | | |
------ ------ ------
|
|
|
------
| 4 |
| R4 |
| |
------
```
There are three hosts connected to each router, but are not displayed in this
`README`. For details see their `zebra` and `staticd` configuration files.
## R1
Interface | Name | Address/Subnet
----------|---------|---------------
0 | lo | 127.0.0.1/32
1 | R1-eth1 | 11.0.1.254/24
2 | R1-eth2 | 11.0.2.254/24
3 | R1-eth3 | 11.0.3.254/24
4 | R1-eth4 | 9.0.0.1/24
5 | R1-eth5 | 9.0.4.1/24
## R2
Interface | Name | Address/Subnet
----------|---------|---------------
0 | lo | 127.0.0.1/32
1 | R2-eth1 | 12.0.1.254/24
2 | R2-eth2 | 12.0.2.254/24
3 | R2-eth3 | 12.0.3.254/24
4 | R2-eth4 | 9.0.0.2/24
5 | R2-eth5 | 9.0.1.1/24
## R3
Interface | Name | Address/Subnet
----------|---------|---------------
0 | lo | 127.0.0.1/32
1 | R3-eth1 | 13.0.1.254/24
2 | R3-eth2 | 13.0.2.254/24
3 | R3-eth3 | 13.0.3.254/24
4 | R3-eth4 | 9.0.1.2/24
## R4
Interface | Name | Address/Subnet
----------|---------|---------------
0 | lo | 127.0.0.1/32
1 | R4-eth1 | 13.0.1.254/24
2 | R4-eth2 | 13.0.2.254/24
3 | R4-eth3 | 13.0.3.254/24
4 | R4-eth4 | 9.0.4.2/24

View File

View File

@ -0,0 +1,36 @@
! -*- bgp -*-
!
! BGPd sample configuratin file
!
! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
!
hostname R1-bgpd
password route0
enable password route0
router bgp 1
bgp router-id 9.0.0.1
network 11.0.0.0/8
neighbor 9.0.0.2 remote-as 2
neighbor 9.0.0.2 ebgp-multihop
neighbor 9.0.0.2 next-hop-self
neighbor 9.0.0.2 timers 5 5
neighbor 9.0.4.2 remote-as 4
neighbor 9.0.4.2 ebgp-multihop
neighbor 9.0.4.2 next-hop-self
neighbor 9.0.4.2 timers 5 5
log file /tmp/R1-bgpd.log
debug bgp as4
debug bgp events
debug bgp filters
debug bgp fsm
debug bgp keepalives
debug bgp updates
!
log stdout

View File

@ -0,0 +1,38 @@
! -*- bgp -*-
!
! BGPd sample configuratin file
!
! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
!
hostname R2-bgpd
password route0
enable password route0
router bgp 2
bgp router-id 9.0.0.2
network 12.0.0.0/8
neighbor 9.0.0.1 remote-as 1
neighbor 9.0.0.1 update-source 9.0.0.2
neighbor 9.0.0.1 ebgp-multihop
neighbor 9.0.0.1 next-hop-self
neighbor 9.0.0.1 timers 5 5
neighbor 9.0.1.2 remote-as 3
neighbor 9.0.1.2 update-source 9.0.1.1
neighbor 9.0.1.2 ebgp-multihop
neighbor 9.0.1.2 next-hop-self
neighbor 9.0.1.2 timers 5 5
log file /tmp/R2-bgpd.log
debug bgp as4
debug bgp events
debug bgp filters
debug bgp fsm
debug bgp keepalives
debug bgp updates
!
log stdout

View File

@ -0,0 +1,30 @@
! -*- bgp -*-
!
! BGPd sample configuratin file
!
! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
!
hostname R3-bgpd
password route0
enable password route0
router bgp 3
bgp router-id 9.0.1.2
network 13.0.0.0/8
neighbor 9.0.1.1 remote-as 2
!neighbor 9.0.1.1 ebgp-multihop 2
neighbor 9.0.1.1 next-hop-self
neighbor 9.0.1.1 timers 5 5
log file /tmp/R3-bgpd.log
debug bgp as4
debug bgp events
debug bgp filters
debug bgp fsm
debug bgp keepalives
debug bgp updates
!
log stdout

View File

@ -0,0 +1,30 @@
! -*- bgp -*-
!
! BGPd sample configuratin file
!
! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
!
hostname R4-bgpd
password route0
enable password route0
router bgp 4
bgp router-id 9.0.4.2
network 13.0.0.0/8
neighbor 9.0.4.1 remote-as 1
neighbor 9.0.4.1 ebgp-multihop
neighbor 9.0.4.1 next-hop-self
neighbor 9.0.4.1 timers 5 5
log file /tmp/R4-bgpd.log
debug bgp as4
debug bgp events
debug bgp filters
debug bgp fsm
debug bgp keepalives
debug bgp updates
!
log stdout

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h1_1-staticd
password route0
enable password route0
ip route 0.0.0.0/0 11.0.1.254
log file /tmp/h1_1-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h1_2-staticd
password route0
enable password route0
ip route 0.0.0.0/0 11.0.2.254
log file /tmp/h1_2-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h1_3-staticd
password route0
enable password route0
ip route 0.0.0.0/0 11.0.3.254
log file /tmp/h1_3-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h2_1-staticd
password route0
enable password route0
ip route 0.0.0.0/0 12.0.1.254
log file /tmp/h2_1-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h2_2-staticd
password route0
enable password route0
ip route 0.0.0.0/0 12.0.2.254
log file /tmp/h2_2-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h2_3-staticd
password route0
enable password route0
ip route 0.0.0.0/0 12.0.3.254
log file /tmp/h2_3-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h3_1-staticd
password route0
enable password route0
ip route 0.0.0.0/0 13.0.1.254
log file /tmp/h3_1-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h3_2-staticd
password route0
enable password route0
ip route 0.0.0.0/0 13.0.2.254
log file /tmp/h3_2-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h3_3-staticd
password route0
enable password route0
ip route 0.0.0.0/0 13.0.3.254
log file /tmp/h3_3-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h4_1-staticd
password route0
enable password route0
ip route 0.0.0.0/0 13.0.1.254
log file /tmp/h4_1-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h4_2-staticd
password route0
enable password route0
ip route 0.0.0.0/0 13.0.2.254
log file /tmp/h4_2-staticd.log debugging

View File

@ -0,0 +1,9 @@
! -*- staticd -*-
hostname h4_3-staticd
password route0
enable password route0
ip route 0.0.0.0/0 13.0.3.254
log file /tmp/h4_3-staticd.log debugging

View File

@ -0,0 +1,56 @@
import os
from mininet.topo import Topo
class NetTopo(Topo):
"""The network topology.
"""
def __init__(self):
# Add default members to class.
super(NetTopo, self).__init__()
# Add routers
r_1 = self.addSwitch('R1')
r_2 = self.addSwitch('R2')
r_3 = self.addSwitch('R3')
r_4 = self.addSwitch('R4')
# Add hosts
h_1_1 = self.addSwitch('h1_1')
h_1_2 = self.addSwitch('h1_2')
h_1_3 = self.addSwitch('h1_3')
h_2_1 = self.addSwitch('h2_1')
h_2_2 = self.addSwitch('h2_2')
h_2_3 = self.addSwitch('h2_3')
h_3_1 = self.addSwitch('h3_1')
h_3_2 = self.addSwitch('h3_2')
h_3_3 = self.addSwitch('h3_3')
h_4_1 = self.addSwitch('h4_1')
h_4_2 = self.addSwitch('h4_2')
h_4_3 = self.addSwitch('h4_3')
# Setup links as shown in README.md
self.addLink(r_1, h_1_1)
self.addLink(r_1, h_1_2)
self.addLink(r_1, h_1_3)
self.addLink(r_2, h_2_1)
self.addLink(r_2, h_2_2)
self.addLink(r_2, h_2_3)
self.addLink(r_3, h_3_1)
self.addLink(r_3, h_3_2)
self.addLink(r_3, h_3_3)
self.addLink(r_4, h_4_1)
self.addLink(r_4, h_4_2)
self.addLink(r_4, h_4_3)
self.addLink(r_1, r_2)
self.addLink(r_2, r_3)
self.addLink(r_4, r_1)

View File

@ -0,0 +1,29 @@
! -*- zebra -*-
hostname R1-zebra
password route0
enable password route0
!
interface lo
no shutdown
interface R1-eth1
ip address 11.0.1.254/24
interface R1-eth2
ip address 11.0.2.254/24
interface R1-eth3
ip address 11.0.3.254/24
!
interface R1-eth4
ip address 9.0.0.1/24
interface R1-eth5
ip address 9.0.4.1/24
log file /tmp/R1-zebra.log debugging

View File

@ -0,0 +1,29 @@
! -*- zebra -*-
hostname R2-zebra
password route0
enable password route0
!
interface lo
no shutdown
interface R2-eth1
ip address 12.0.1.254/24
interface R2-eth2
ip address 12.0.2.254/24
interface R2-eth3
ip address 12.0.3.254/24
!
interface R2-eth4
ip address 9.0.0.2/24
interface R2-eth5
ip address 9.0.1.1/24
log file /tmp/R2-zebra.log debugging

View File

@ -0,0 +1,26 @@
! -*- zebra -*-
hostname R3-zebra
password route0
enable password route0
!
interface lo
no shutdown
interface R3-eth1
ip address 13.0.1.254/24
interface R3-eth2
ip address 13.0.2.254/24
interface R3-eth3
ip address 13.0.3.254/24
!
interface R3-eth4
ip address 9.0.1.2/24
log file /tmp/R3-zebra.log debugging

View File

@ -0,0 +1,26 @@
! -*- zebra -*-
hostname R4-zebra
password route0
enable password route0
!
interface lo
no shutdown
interface R4-eth1
ip address 13.0.1.254/24
interface R4-eth2
ip address 13.0.2.254/24
interface R4-eth3
ip address 13.0.3.254/24
!
interface R4-eth4
ip address 9.0.4.2/24
log file /tmp/R4-zebra.log

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h1_1-zebra
password route0
enable password route0
interface lo
no shutdown
interface h1_1-eth1
ip address 11.0.1.1/24
log file /tmp/h1_1-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h1_2-zebra
password route0
enable password route0
interface lo
no shutdown
interface h1_2-eth1
ip address 11.0.2.1/24
log file /tmp/h1_2-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h1_3-zebra
password route0
enable password route0
interface lo
no shutdown
interface h1_3-eth1
ip address 11.0.3.1/24
log file /tmp/h1_3-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h2_1-zebra
password route0
enable password route0
interface lo
no shutdown
interface h2_1-eth1
ip address 12.0.1.1/24
log file /tmp/h2_1-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h2_2-zebra
password route0
enable password route0
interface lo
no shutdown
interface h2_2-eth1
ip address 12.0.2.1/24
log file /tmp/h2_2-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h2_3-zebra
password route0
enable password route0
interface lo
no shutdown
interface h2_3-eth1
ip address 12.0.3.1/24
log file /tmp/h2_3-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h3_1-zebra
password route0
enable password route0
interface lo
no shutdown
interface h3_1-eth1
ip address 13.0.1.1/24
log file /tmp/h3_1-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h3_2-zebra
password route0
enable password route0
interface lo
no shutdown
interface h3_2-eth1
ip address 13.0.2.1/24
log file /tmp/h3_2-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h3_3-zebra
password route0
enable password route0
interface lo
no shutdown
interface h3_3-eth1
ip address 13.0.3.1/24
log file /tmp/h3_3-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h4_1-zebra
password route0
enable password route0
interface lo
no shutdown
interface h4_1-eth1
ip address 13.0.1.1/24
log file /tmp/h4_1-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h4_2-zebra
password route0
enable password route0
interface lo
no shutdown
interface h4_2-eth1
ip address 13.0.2.1/24
log file /tmp/h4_2-zebra.log debugging

View File

@ -0,0 +1,13 @@
! -*- zebra -*-
hostname h4_3-zebra
password route0
enable password route0
interface lo
no shutdown
interface h4_3-eth1
ip address 13.0.3.1/24
log file /tmp/h4_3-zebra.log debugging