Enable Debugging BGP in JUNOS

  • 0
protocols {
    bgp {
        traceoptions {
            file bgplog size 150k files 10;
            flag all detail;
        }

root@TATA> monitor start bgplog


root@TATA>
*** bgplog ***
Mar 28 10:09:39.822544 task_process_events: recv ready for BGP_1200_1100.1.1.1.10+22316
Mar 28 10:09:39.822562 task_job_create_background: create prio 4 job Read peer for task BGP_1200_1100.1.1.1.10+22316
Mar 28 10:09:39.822568 background dispatch running job Read peer for task BGP_1200_1100.1.1.1.10+22316
Mar 28 10:09:39.822570 bgp_read_v4_message: receiving packet(s) from 1.1.1.10 (External AS 1200)
Mar 28 10:09:39.822576
Mar 28 10:09:39.822576 BGP RECV 1.1.1.10+22316 -> 1.1.1.9+179
Mar 28 10:09:39.822579 BGP RECV message type 4 (KeepAlive) length 19
Mar 28 10:09:39.822581 bgp_read_v4_message: done with 1.1.1.10 (External AS 1200) received 19 octets 0 updates 0 routes
Mar 28 10:09:39.822583 task_job_delete: delete background job Read peer for task BGP_1200_1100.1.1.1.10+22316
Mar 28 10:09:39.822663 background dispatch completed job Read peer for task BGP_1200_1100.1.1.1.10+22316

Check received and advertised routes in Juniper



root@TATA# show
## Last changed: 2019-03-28 09:56:16 UTC
version 10.1R1.8;
system {
    host-name TATA;
    root-authentication {
        encrypted-password "$1$K.6Gp.oA$.CvkXlWMxq8GDwxSnr4/D/"; ## SECRET-DATA
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    em0 {
        unit 0 {
            description IKF_CORE;
            family inet {
                address 1.1.1.1/30;
            }
        }
    }
    em2 {
        unit 0 {
            description SIFY;
            family inet {
                address 1.1.1.9/30;
            }
        }
    }
    em7 {
        unit 0 {
            family inet {
                address 1.1.0.2/30;
            }
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 {
            next-hop 1.1.0.1;
            install;
        }
        route 1.1.0.0/24 discard;
        route 1.1.1.0/24 discard;
        route 1.1.2.0/24 discard;
        route 1.1.3.0/24 discard;
        route 1.1.4.0/24 discard;
        route 1.1.5.0/24 discard;
    }
}
protocols {
    bgp {
        traceoptions {
            file bgplog size 1000k files 10;
            flag all detail;
        }
        local-as 1100;
        group IKF {
            import IKF_IN;
            export IKF_OUT;
            neighbor 1.1.1.2 {
                description IKF_CORE;
                peer-as 1300;
            }
            neighbor 1.1.1.6 {
                description IKF_MUMBAI;
                peer-as 1300;
            }
        }
        group SIFY {
            peer-as 1200;
            neighbor 1.1.1.10;
        }
    }
}
policy-options {
    prefix-list IKF_IN {
        1.3.0.0/24;
        1.3.1.0/24;
        1.3.2.0/24;
        1.3.3.0/24;
    }
    prefix-list TATA_OUT {
        1.1.0.0/24;
        1.1.1.0/24;
        1.1.2.0/24;
        1.1.3.0/24;
        1.2.0.0/24;
        1.2.1.0/24;
        1.2.2.0/24;
        1.2.3.0/24;
    }
    policy-statement IKF_IN {
        term 1 {
            from {
                prefix-list IKF_IN;
            }
            then accept;
        }
        term 2 {
            from {
                route-filter 0.0.0.0/0 orlonger;
            }
            then reject;
        }
    }
    policy-statement IKF_OUT {
        term 2 {
            from {
                prefix-list TATA_OUT;
            }
            then accept;
        }
        term 3 {
            from {
                route-filter 0.0.0.0/0 orlonger;
            }
            then reject;
        }
    }
}


===================

Mikrotik Configuration:
 /interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
    mac-cookie-timeout=3d
/port
set 0 name=serial0
/routing bgp instance
set default as=1300 router-id=1.3.0.1
/tool user-manager customer
add backup-allowed=yes disabled=no login=admin password="" \
    paypal-accept-pending=no paypal-allowed=no paypal-secure-response=no \
    permissions=owner signup-allowed=no time-zone=-00:00
/ip address
add address=1.1.1.2/30 interface=ether1 network=1.1.1.0
add address=192.168.125.1/24 interface=ether8 network=192.168.125.0
/routing bgp network
add network=1.3.0.0/24
add network=1.3.1.0/24
add network=1.3.2.0/24
add network=1.3.3.0/24 synchronize=no
add network=1.3.4.0/24 synchronize=no
/routing bgp peer
add in-filter=TATA_IN name=TATA out-filter=TATA_OU remote-address=1.1.1.1 \
    remote-as=1100
/routing filter
add action=accept chain=TATA_OU prefix=1.3.3.0/24 set-bgp-communities=1300:10
add action=accept chain=TATA_OU prefix=1.3.2.0/24 set-bgp-communities=1300:10
/system identity
set name=IKF_CORE
/system lcd
set contrast=0 enabled=no port=parallel type=24x4
/system lcd page
set time disabled=yes display-time=5s
set resources disabled=yes display-time=5s
set uptime disabled=yes display-time=5s
set packets disabled=yes display-time=5s
set bits disabled=yes display-time=5s
set version disabled=yes display-time=5s
set identity disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
set ether2 disabled=yes display-time=5s
set ether3 disabled=yes display-time=5s
set ether4 disabled=yes display-time=5s
set ether5 disabled=yes display-time=5s
set ether6 disabled=yes display-time=5s
set ether7 disabled=yes display-time=5s
set ether8 disabled=yes display-time=5s
/system logging
add topics=bgp
===================
Cisco Configuration:

root@TATA# run show route receive-protocol bgp 1.1.1.2

inet.0: 13 destinations, 13 routes (12 active, 0 holddown, 1 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.3.3.0/24              1.1.1.2                                 1300 I

[edit]
root@TATA# run show route advertising-protocol bgp 1.1.1.2

inet.0: 13 destinations, 13 routes (12 active, 0 holddown, 1 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.1.0.0/24              Self                                    I
* 1.1.1.0/24              Self                                    I
* 1.1.2.0/24              Self                                    I
* 1.1.3.0/24              Self                                    I

[edit]
root@TATA#
===================

Cisco Configuration:

SIFY#show run
Building configuration...

Current configuration : 3085 bytes
!
upgrade fpd auto
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SIFY
!
boot-start-marker
boot-end-marker
!
logging message-counter syslog
!
no aaa new-model
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface FastEthernet0/0
 description "TATA"
 ip address 1.1.1.10 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Ethernet1/0
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/3
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/4
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/5
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/6
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/7
 no ip address
 shutdown
 duplex half
!
interface GigabitEthernet2/0
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet3/0
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet4/0
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet5/0
 no ip address
 shutdown
 negotiation auto
!
interface Serial6/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/4
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/5
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/6
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial6/7
 no ip address
 shutdown
 serial restart-delay 0
!
router bgp 1200
 no synchronization
 bgp log-neighbor-changes
 network 1.2.0.0 mask 255.255.255.0
 network 1.2.1.0 mask 255.255.255.0
 network 1.2.2.0 mask 255.255.255.0
 network 1.2.3.0 mask 255.255.255.0
 neighbor 1.1.1.9 remote-as 1100
 neighbor 1.1.1.9 description TATA
 neighbor 1.1.1.9 route-map TATA_OUT out
 no auto-summary
!
ip forward-protocol nd
ip route 1.2.0.0 255.255.255.0 Null0
ip route 1.2.1.0 255.255.255.0 Null0
ip route 1.2.2.0 255.255.255.0 Null0
ip route 1.2.3.0 255.255.255.0 Null0
no ip http server
no ip http secure-server
!
!
!
!
ip prefix-list TATA_OUT seq 1 permit 1.2.0.0/24
ip prefix-list TATA_OUT seq 2 permit 1.2.1.0/24
no cdp log mismatch duplex
!
!
!
!
route-map TATA_OUT permit 0
 match ip address prefix-list TATA_OUT
 set as-path prepend 1200 1200 1200 1200 1200 1200
!
!
!
control-plane
!
!
!
!
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
end

SIFY#
===================

SIFY#show ip bgp  neighbors 1.1.1.9 advertised-routes
BGP table version is 9, local router ID is 1.1.1.10
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.2.0.0/24       0.0.0.0                  0         32768 i
*> 1.2.1.0/24       0.0.0.0                  0         32768 i

Total number of prefixes 2


Filtering routes using prefix Lists in Juniper

Mikrotik Configuration:
admin@IKF_CORE] >
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
    mac-cookie-timeout=3d
/port
set 0 name=serial0
/routing bgp instance
set default as=1300
/tool user-manager customer
add backup-allowed=yes disabled=no login=admin password="" \
    paypal-accept-pending=no paypal-allowed=no paypal-secure-response=no \
    permissions=owner signup-allowed=no time-zone=-00:00
/ip address
add address=1.1.1.2/30 interface=ether1 network=1.1.1.0
add address=192.168.125.1/24 interface=ether8 network=192.168.125.0
/routing bgp network
add network=1.3.0.0/24 synchronize=no
add network=1.3.1.0/24
add network=1.3.2.0/24
add network=1.3.3.0/24
add network=1.3.4.0/24 synchronize=no
add network=1.3.5.0/24 synchronize=no
/routing bgp peer
add name=TATA remote-address=1.1.1.1 remote-as=1100
/system identity
set name=IKF_CORE
/system lcd
set contrast=0 enabled=no port=parallel type=24x4
/system lcd page
set time disabled=yes display-time=5s
set resources disabled=yes display-time=5s
set uptime disabled=yes display-time=5s
set packets disabled=yes display-time=5s
set bits disabled=yes display-time=5s
set version disabled=yes display-time=5s
set identity disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
set ether2 disabled=yes display-time=5s
set ether3 disabled=yes display-time=5s
set ether4 disabled=yes display-time=5s
set ether5 disabled=yes display-time=5s
set ether6 disabled=yes display-time=5s
set ether7 disabled=yes display-time=5s
set ether8 disabled=yes display-time=5s
[admin@IKF_CORE] >

Juniper Configuration:

root@TATA# show
## Last changed: 2019-03-28 01:05:16 UTC
version 10.1R1.8;
system {
    host-name TATA;
    root-authentication {
        encrypted-password "$1$K.6Gp.oA$.CvkXlWMxq8GDwxSnr4/D/"; ## SECRET-DATA
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    em0 {
        unit 0 {
            description IKF_CORE;
            family inet {
                address 1.1.1.1/30;
            }
        }
    }
}
protocols {
    bgp {
        traceoptions {
            file bgplog size 1000k files 10;
            flag all detail;
            flag open;
        }
        local-as 1100;
        group IKF {
            import IKF_IN;
            neighbor 1.1.1.2 {
                description IKF_CORE;
                peer-as 1300;
            }
            neighbor 1.1.1.6 {
                description IKF_MUMBAI;
                peer-as 1300;
            }
        }
    }
}
policy-options {
    prefix-list IKF_IN {
        1.3.0.0/24;
        1.3.1.0/24;
        1.3.2.0/24;
        1.3.3.0/24;
    }
    policy-statement IKF_IN {
        term 1 {
            from {
                prefix-list IKF_IN;
            }
            then accept;
        }
        term 2 {
            from {
                route-filter 0.0.0.0/0 orlonger;
            }
            then reject;
        }
    }
}

[edit]
root@TATA#

[edit]
root@TATA# show
## Last changed: 2019-03-28 01:05:16 UTC
version 10.1R1.8;
system {
    host-name TATA;
    root-authentication {
        encrypted-password "$1$K.6Gp.oA$.CvkXlWMxq8GDwxSnr4/D/"; ## SECRET-DATA
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    em0 {
        unit 0 {
            description IKF_CORE;
            family inet {
                address 1.1.1.1/30;
            }
        }
    }
}
protocols {
    bgp {
        traceoptions {
            file bgplog size 1000k files 10;
            flag all detail;
            flag open;
        }
        local-as 1100;
        group IKF {
            import IKF_IN;
            neighbor 1.1.1.2 {
                description IKF_CORE;
                peer-as 1300;
            }
            neighbor 1.1.1.6 {
                description IKF_MUMBAI;
                peer-as 1300;
            }
        }
    }
}
policy-options {
    prefix-list IKF_IN {
        1.3.0.0/24;
        1.3.1.0/24;
        1.3.2.0/24;
        1.3.3.0/24;
    }
    policy-statement IKF_IN {
        term 1 {
            from {
                prefix-list IKF_IN;
            }
            then accept;
        }
        term 2 {
            from {
                route-filter 0.0.0.0/0 orlonger;
            }
            then reject;
        }
    }
}

[edit]
root@TATA#
----------------------

root@TATA> show route

inet.0: 5 destinations, 5 routes (3 active, 0 holddown, 2 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.0/30         *[Direct/0] 09:22:28
                    > via em0.0
1.1.1.1/32         *[Local/0] 09:22:28
                      Local via em0.0
1.3.0.0/24         *[BGP/170] 00:27:36, localpref 100
                      AS path: 1300 I
                    > to 1.1.1.2 via em0.0
-----------------------

oot@TATA> Mar 28 01:10:05.806642 task_process_events: recv ready for BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:05.806661 task_job_create_background: create prio 4 job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:05.806669 background dispatch running job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:05.806671 bgp_read_v4_message: receiving packet(s) from 1.1.1.2 (External AS 1300)
Mar 28 01:10:05.806677
Mar 28 01:10:05.806677 BGP RECV 1.1.1.2+51194 -> 1.1.1.1+179
Mar 28 01:10:05.806680 BGP RECV message type 2 (Update) length 47
Mar 28 01:10:05.806681 BGP RECV Update PDU length 47
Mar 28 01:10:05.806683 BGP RECV flags 0x40 code Origin(1): IGP
Mar 28 01:10:05.806714 BGP RECV flags 0x40 code ASPath(2) length 6: 1300
Mar 28 01:10:05.806716 BGP RECV flags 0x40 code NextHop(3): 1.1.1.2
Mar 28 01:10:05.806721 BGP RECV         1.3.0.0/24
Mar 28 01:10:05.806763 bgp_should_merge_as2_and_as4_path():2083 AS4-Peer 1.1.1.2 (External AS 1300)(RECV): No merge of as-paths required as the peer is 4 byte as capable
Mar 28 01:10:05.806766 bgp_process_aspath_and_aggr_attr():2512 AS4-Peer 1.1.1.2 (External AS 1300)(RECV): bgp_should_merge_as2_and_as4_path() says NO
Mar 28 01:10:05.806768 bgp_process_aspath_and_aggr_attr():2549 AS4-Peer 1.1.1.2 (External AS 1300)(RECV): Merged asp: path_len 4, path_seg_len 2, path2_len 0, path2_seg_len 0, path4_len 0, path4_seg_len 0, path_attr_len 0, path_aggr_len 0, path4_aggr_len 0, path4_flags 0x0, path_flags 0x0
Mar 28 01:10:05.806779 bgp_rcv_nlri: Peer 1.1.1.2 (External AS 1300)
Mar 28 01:10:05.806781 bgp_rcv_nlri: 1.3.0.0/24
Mar 28 01:10:05.806877 CHANGE   1.3.0.0/24         gw 1.1.1.2         BGP      pref 170/-101 metric  em0.0 <Active Ext>  as 1300
Mar 28 01:10:05.806883 ADD      1.3.0.0/24         gw 1.1.1.2         BGP      pref 170/-101 metric  em0.0 <Active Ext>  as 1300
Mar 28 01:10:05.806888 rt_close: 1 route proto BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:05.806888
Mar 28 01:10:05.806915 bgp_read_v4_message: done with 1.1.1.2 (External AS 1300) received 47 octets 1 update 1 route
Mar 28 01:10:05.806919 task_job_delete: delete background job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:05.806924 background dispatch completed job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:05.806938 rt_flash_update_callback: flash BGP_Group_IKF (inet.0) start
Mar 28 01:10:05.806940 bgp_rt_policy_start: flash update group IKF type External
Mar 28 01:10:05.806971 bgp_rt_policy_end: group IKF type External 0 routes ready 0 deferred
Mar 28 01:10:05.806975 rt_flash_update_callback: flash BGP_Group_IKF (inet.0) done
Mar 28 01:10:08.001571 task_process_events: recv ready for BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:08.001614 task_job_create_background: create prio 4 job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:08.001622 background dispatch running job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:08.001624 bgp_read_v4_message: receiving packet(s) from 1.1.1.2 (External AS 1300)
Mar 28 01:10:08.001639
Mar 28 01:10:08.001639 BGP RECV 1.1.1.2+51194 -> 1.1.1.1+179
Mar 28 01:10:08.001642 BGP RECV message type 4 (KeepAlive) length 19
Mar 28 01:10:08.001645 bgp_read_v4_message: done with 1.1.1.2 (External AS 1300) received 19 octets 0 updates 0 routes
Mar 28 01:10:08.001646 task_job_delete: delete background job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:08.001657 background dispatch completed job Read peer for task BGP_1300_1100.1.1.1.2+51194
Mar 28 01:10:08.039231 task_timer_dispatch: calling BGP_1300_1100.1.1.1.2+51194_Traffic, late by 0.005
Mar 28 01:10:08.039239 bgp_keepalive_timeout: peer 1.1.1.2 (External AS 1300) last checked 31 last recv'd 0 last sent 29 last keepalive 29
Mar 28 01:10:08.039241 bgp_send: sending 19 bytes to 1.1.1.2 (External AS 1300)
Mar 28 01:10:08.039242
Mar 28 01:10:08.039242 BGP SEND 1.1.1.1+179 -> 1.1.1.2+51194
Mar 28 01:10:08.039244 BGP SEND message type 4 (KeepAlive) length 19
Mar 28 01:10:08.039994 task_timer_reset: reset BGP_1300_1100.1.1.1.2+51194_Traffic
Mar 28 01:10:08.039999 task_timer_set_oneshot_latest: timer BGP_1300_1100.1.1.1.2+51194_Traffic interval set to 25.756627
Mar 28 01:10:08.040001 task_timer_dispatch: returned from BGP_1300_1100.1.1.1.2+51194_Traffic, rescheduled in 25.756
Mar 28 01:10:10.889876 task_timer_dispatch: calling BGP RT Background_BGP reuse, late by 0.162
Mar 28 01:10:10.889902 bgp_reuse_scan: Starting scan
Mar 28 01:10:10.889906 task_timer_dispatch: returned from BGP RT Background_BGP reuse, rescheduled in 19.805
root@TATA> monitor stop


Best Cisco IOS for GNS3

  • 0
The best IOS version to emulate everything on GNS3 is IOS 7200. With this you can do everything. Frame-Relay Switch to BGP, ISIS etc, just everything.

For switching you have to use IOU. You can't rely on Swicth Module with 3640.

I'm using Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)S3, RELEASE SOFTWARE (fc1) for Frame-Relay Switch Lab.


S2(config)#do show run | inc switch
frame-relay switching

Installing HCL 7.1.59 on Windows 10 alongside ENSP with VirtualBox version 5.1.x

HCL 7.1.59 will not install with VirtualBox Version 5.1.x, throwing an error, "VirtualBox version is not Supported" installer will Quit.

You can fix this and install H3C Cloud Lab by doing the following:
After installing Oracle VirtualBox v5.1.24 open "regedit" and edit the following Key
HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\VirtualBox
Change Version to 4.2.18 from 5.1.24 then start the installer. After you are done change back to 5.1.x.
Better if you install ENSP first, then HCL 7.1.59.
Mine came with Oracle VirtualBox 5.1.24 and it works well. I had to install the vbox extension separately.


Basic BGP Configuration. iBGP and eBGP

  • 0
When two BGP peers from different autonomous systems peers with each other it's called eBGP. When the peers belong to the same ASN, they are in an iBGP.

Below is an example configuration of setting up BGP with Juniper and Mikrotik:

Juniper Configuration:
----------------------------------------------------------------------------------------------
root@TATA> configure
Entering configuration mode
The configuration has been changed but not committed

[edit]
root@TATA# show
## Last changed: 2019-03-25 12:07:10 UTC
version 10.1R1.8;
system {
    host-name TATA;
    root-authentication {
        encrypted-password "$1$/okW5cvo$LbfKdybOk7sPp9PGWaU0c0"; ## SECRET-DATA
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 1.1.1.1/30;
            }
        }
    }
}
routing-options {
    static {
        route 1.1.1.0/24 {
            install;
            active;
        }
    }
    router-id 1.1.1.1;
    autonomous-system 1100;
}
protocols {
    bgp {
        group ABC {
            type external;
            export ABC_OUT;
            peer-as 1300;
            neighbor 1.1.1.2;
        }
    }
}
policy-options {
    policy-statement ABC_OUT {
        term 1 {
            from {
                protocol direct;
                route-filter 1.1.1.0/24 exact;
                route-filter 1.1.2.0/24 exact;
                route-filter 1.1.3.0/24 exact;
                route-filter 1.1.4.0/24 exact;
            }
            then accept;
        }
    }
}

[edit]
root@TATA#
----------------------------------------------------------------------------------------------
ABC_DISTRIBUTION

/interface ethernet
set [ find default-name=ether3 ] arp=reply-only
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool0 ranges=1.3.1.2-1.3.1.254
/ip dhcp-server
add add-arp=yes address-pool=dhcp_pool0 disabled=no interface=ether3 name=\
    dhcp1
/routing ospf area
add area-id=1.1.1.1 default-cost=1 inject-summary-lsas=yes name=\
    ABC_DISTRIBUTION type=stub
/ip address
add address=192.168.125.3/24 comment=MGMT interface=ether12 network=\
    192.168.125.0
add address=1.3.0.2/30 comment=WAN interface=ether1 network=1.3.0.0
add address=1.3.0.5/30 comment=LAN1 interface=ether2 network=1.3.0.4
add address=1.3.1.1/24 comment=LAN2 interface=ether3 network=1.3.1.0
add address=1.3.2.1/24 interface=ether3 network=1.3.2.0
add address=1.3.3.1/24 interface=ether3 network=1.3.3.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dhcp-server network
add address=1.3.1.0/24 dns-server=1.3.1.1 gateway=1.3.1.1
/ip route
add distance=1 gateway=1.3.0.1
/routing ospf area range
add area=ABC_DISTRIBUTION range=1.3.0.0/22
/routing ospf interface
add authentication=md5 authentication-key=1452 interface=ether1 network-type=\
    point-to-point priority=2
add interface=ether12 network-type=broadcast passive=yes
/routing ospf network
add area=ABC_DISTRIBUTION network=1.3.0.0/24
add area=ABC_DISTRIBUTION network=1.3.1.0/24
add area=ABC_DISTRIBUTION network=1.3.2.0/24
add area=ABC_DISTRIBUTION network=1.3.3.0/24
add area=backbone network=1.3.0.0/30
/system identity
set name=ABC_DISTRIBUTION
----------------------------------------------------------------------------------------------
ABC_CORE

/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=1300 redistribute-ospf=yes
/ip address
add address=1.1.1.2/30 comment=TATA interface=ether1 network=1.1.1.0
add address=192.168.125.2/24 comment=MGMT interface=ether12 network=\
    192.168.125.0
add address=1.3.0.1/30 comment="ABC DISTRIBUTION" interface=ether2 network=\
    1.3.0.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/routing bgp network
/routing bgp peer
add name=TATA remote-address=1.1.1.1 remote-as=1100
/routing ospf interface
add authentication=md5 authentication-key=1452 interface=ether2 network-type=\
    point-to-point
add interface=ether12 network-type=broadcast passive=yes
/routing ospf network
add area=backbone network=1.3.0.0/30
/system identity
set name=ABC