Sunday, September 4, 2016

test network confgiuration with core-network

core-network is  Common Open Research Emulator, can can emulator many protocol, such as rip, ospf2 or ospf3, bgp, etc. it use xorp or zebra as the backend.


1- install core-network
$ sudo apt-get install core-network-gui core-network

2- to run core-network gui use the following command
$ core-gui

3- when you add routers and connect them together, core-network will automatically assign ip addresses and by default it will run ospf2 and ospf3 in zebra. so after you run your emulation, all networks will be converged with ospf2 and ospf3 protocol

4- and if you choose to enable bgp, it also assign ip address and as number automatically.

the following, i will configure bpg without any inbound/outbound filtering.
- network diagram

5- choose service bgpd on all the routers



6- configure of bgp on all routers
- n1
router bgp 1
 bgp router-id 10.0.0.1
 network 10.0.0.0/8
 redistribute connected
 neighbor n2 peer-group
 neighbor n2 remote-as 2
 neighbor n2 soft-reconfiguration inbound
 neighbor n3 peer-group
 neighbor n3 remote-as 3
 neighbor n3 soft-reconfiguration inbound
 neighbor 10.0.0.2 peer-group n2
 neighbor 10.0.2.2 peer-group n3
 exit


-n2
router bgp 2
 bgp router-id 10.0.0.2
 network 10.0.0.0/8
 redistribute connected
 neighbor n1 peer-group
 neighbor n1 remote-as 1
 neighbor n1 soft-reconfiguration inbound
 neighbor n5 peer-group
 neighbor n5 remote-as 5
 neighbor n5 soft-reconfiguration inbound
 neighbor 10.0.0.1 peer-group n1
 neighbor 10.0.1.2 peer-group n5
 exit


-n3
router bgp 3
 bgp router-id 10.0.2.2
 network 10.0.0.0/8
 redistribute connected
 neighbor n1 peer-group
 neighbor n1 remote-as 1
 neighbor n1 soft-reconfiguration inbound
 neighbor n4 peer-group
 neighbor n4 remote-as 4
 neighbor n4 soft-reconfiguration inbound
 neighbor 10.0.2.1 peer-group n1
 neighbor 10.0.3.2 peer-group n4
 exit


-n4
router bgp 4
 bgp router-id 10.0.3.2
 network 10.0.0.0/8
 redistribute connected
 neighbor n3 peer-group
 neighbor n3 remote-as 3
 neighbor n3 soft-reconfiguration inbound
 neighbor n5 peer-group
 neighbor n5 remote-as 5
 neighbor n5 soft-reconfiguration inbound
 neighbor 10.0.3.1 peer-group n3
 neighbor 10.0.4.2 peer-group n5
 exit


-n5
router bgp 5
 bgp router-id 10.0.1.2
 network 10.0.0.0/8
 redistribute connected
 neighbor n2 peer-group
 neighbor n2 remote-as 2
 neighbor n2 soft-reconfiguration inbound
 neighbor n4 peer-group
 neighbor n4 remote-as 4
 neighbor n4 soft-reconfiguration inbound
 neighbor 10.0.1.1 peer-group n2
 neighbor 10.0.4.1 peer-group n4
 exit


7- show ip route and ip bgp pass on router1
n1# show ip route
WARNING: terminal is not fully functional
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, A - Babel,
       > - selected route, * - FIB route

C>* 10.0.0.0/24 is directly connected, eth0
B>* 10.0.1.0/24 [20/0] via 10.0.0.2, eth0, 00:45:03
C>* 10.0.2.0/24 is directly connected, eth1
B>* 10.0.3.0/24 [20/0] via 10.0.2.2, eth1, 00:28:43
B>* 10.0.4.0/24 [20/0] via 10.0.0.2, eth0, 00:39:33
C>* 127.0.0.0/8 is directly connected, lo


n1# show ip bgp paths
WARNING: terminal is not fully functional
Address Refcnt Path
[0x557a99cf4b30:2347207637] (2) 3 4
[0x557a99cb14d0:2448081105] (9)
[0x557a99cf6720:3804810696] (7) 3
[0x557a99ce66c0:339860207] (3) 2 5
[0x557a99ce5f30:4096851189] (7) 2




-the following is the link to download file imn of the core-network above
bgp-networks.imn

No comments:

Post a Comment