#on router 1

hostname R1
int f0/0
ip address 156.10.0.1 255.255.255.0
no shutdown
int f1/0
ip address 186.10.0.1 255.255.255.0
no shutdown
int f1/1
ip address 146.10.0.1 255.255.255.0
no shutdown
router bgp 200
neighbor 186.10.0.2 remote-as 100
neighbor 146.10.0.2 remote-as 400

network 156.10.0.0 mask 255.255.255.0

#on router 2

hostname R2
int f0/0
ip address 166.10.0.1 255.255.255.0
no shutdown
int f1/0
ip address 186.10.0.2 255.255.255.0
no shutdown
int f1/1
ip address 196.10.0.1 255.255.255.0
no shutdown
router bgp 100
neighbor 186.10.0.1 remote-as 200
neighbor 196.10.0.2 remote-as 300

network 166.10.0.0 mask 255.255.255.0

#on router 3

hostname R3

int f0/0
ip address 176.10.0.1 255.255.255.0
no shutdown
int f1/0
ip address 196.10.0.2 255.255.255.0
no shutdown
int f1/1
ip address 136.10.0.2 255.255.255.0
no shutdown
router bgp 300
neighbor 196.10.0.1 remote-as 100
neighbor 136.10.0.1 remote-as 400

network 176.10.0.0 mask 255.255.255.0


#on router 4

hostname R4

int f1/0
ip address 126.10.0.1 255.255.255.0
no shutdown

int f1/0
ip address 146.10.0.2 255.255.255.0
no shutdown

int f1/1
ip address 136.10.0.1 255.255.255.0
no shutdown

router bgp 400
neighbor 146.10.0.1 remote-as 200
neighbor 136.10.0.2 remote-as 300

network 126.10.0.0 mask 255.255.255.0

route-map PREPEND permit 10
set as-path prepend 400 400 400

router bgp 400
neighbor 136.10.0.2 route-map PREPEND out

