Thursday, May 24, 2018

BGP dan OSPF pada Juniper


lab@JunOS-01> show configuration | display set
set version 12.1R1.9
set system host-name JunOS-01
set system root-authentication encrypted-password "$1$KTMPqph5$0A.0bR77PuLuYCU5j.FBY."
set system login user lab full-name lab
set system login user lab uid 2000
set system login user lab class super-user
set system login user lab authentication encrypted-password "$1$5.JcMZvh$cwkjDOpkXw80eMMJJEZMH0"
set system services ssh
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces em0 unit 0 description LAN
set interfaces em0 unit 0 family inet address 192.168.1.1/24
set interfaces em1 description "Link To JunOS-02"
set interfaces em1 unit 0 family inet address 10.1.2.1/29
set interfaces em2 unit 0 description "Link TO JunOS-03"
set interfaces em2 unit 0 family inet address 10.1.3.1/29
set interfaces lo0 unit 0 family inet address 10.10.10.1/32
set routing-options static route 10.2.3.0/29 next-hop 10.1.2.2
set routing-options static route 192.168.3.0/24 next-hop 10.1.3.3
set routing-options static route 192.168.2.0/24 next-hop 10.1.2.2
deactivate routing-options static
set routing-options router-id 10.10.10.1
set routing-options autonomous-system 12
set protocols bgp group INT-AS-12 type internal
set protocols bgp group INT-AS-12 local-address 10.10.10.1
set protocols bgp group INT-AS-12 neighbor 10.10.10.2
set protocols bgp group EXT-AS-30 type external
set protocols bgp group EXT-AS-30 export ADV-TO-EBGP
set protocols bgp group EXT-AS-30 peer-as 30
set protocols bgp group EXT-AS-30 neighbor 10.1.3.3
set protocols ospf area 0.0.0.0 interface em0.0
set protocols ospf area 0.0.0.0 interface em1.0
set protocols ospf area 0.0.0.0 interface lo0.0
set policy-options policy-statement ADV-TO-EBGP term OSPF from protocol ospf
set policy-options policy-statement ADV-TO-EBGP term OSPF then accept
set policy-options policy-statement ADV-TO-EBGP term DIRECT from protocol direct
set policy-options policy-statement ADV-TO-EBGP term DIRECT then accept


###############
lab@JunOS-02> show configuration | display set
set version 12.1R1.9
set system host-name JunOS-02
set system root-authentication encrypted-password lab123
set system login user lab full-name lab
set system login user lab uid 2000
set system login user lab class super-user
set system login user lab authentication encrypted-password "$1$NoeajaUr$LISb6g.SBDm63SXFNRV3Q0"
set system services ssh
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces em0 description "Link To JunOS-01"
set interfaces em0 unit 0 family inet address 10.1.2.2/29
set interfaces em1 unit 0 description "Link To JunOS-03"
set interfaces em1 unit 0 family inet address 10.2.3.2/29
set interfaces em2 unit 0 description LAN
set interfaces em2 unit 0 family inet address 192.168.2.1/24
set interfaces lo0 unit 0 family inet address 10.10.10.2/32
set routing-options static route 10.1.3.0/29 next-hop 10.1.2.1
set routing-options static route 192.168.1.0/24 next-hop 10.1.2.1
set routing-options static route 192.168.3.0/24 next-hop 10.2.3.3
deactivate routing-options static
set routing-options router-id 10.10.10.2
set routing-options autonomous-system 12
set protocols bgp group INT-AS-12 type internal
set protocols bgp group INT-AS-12 local-address 10.10.10.2
set protocols bgp group INT-AS-12 neighbor 10.10.10.1
set protocols bgp group EXT-AS-30 type external
set protocols bgp group EXT-AS-30 export ADV-TO-EBGP
set protocols bgp group EXT-AS-30 peer-as 30
set protocols bgp group EXT-AS-30 neighbor 10.2.3.3
set protocols ospf area 0.0.0.0 interface em0.0
set protocols ospf area 0.0.0.0 interface lo0.0
set protocols ospf area 0.0.0.0 interface em2.0
set policy-options policy-statement ADV-TO-EBGP term OSPF from protocol ospf
set policy-options policy-statement ADV-TO-EBGP term OSPF then accept
set policy-options policy-statement ADV-TO-EBGP term DIRECT from protocol direct
set policy-options policy-statement ADV-TO-EBGP term DIRECT then accept

#########################
lab@JunOS-03> show configuration | display set
set version 12.1R1.9
set system host-name JunOS-03
set system root-authentication encrypted-password lab123
set system login user lab full-name lab
set system login user lab uid 2000
set system login user lab class super-user
set system login user lab authentication encrypted-password "$1$BFY2bP9a$owL4lizDHURAIglozXQsE0"
set system services ssh
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces em0 unit 0 description "Link To JunOS-02"
set interfaces em0 unit 0 family inet address 10.2.3.3/29
set interfaces em1 unit 0 description "Link To JunOS-01"
set interfaces em1 unit 0 family inet address 10.1.3.3/29
set interfaces em2 unit 0 description LAN
set interfaces em2 unit 0 family inet address 192.168.3.1/24
set interfaces em3 unit 0 family inet address 1.1.1.1/24
set interfaces em4 unit 0 family inet address 2.2.2.2/24
set interfaces em5 unit 0 family inet address 1.1.1.1/24
set interfaces em5 unit 0 family inet address 3.3.3.3/24
set interfaces em6 unit 0 family inet address 2.2.2.1/24
set interfaces em7 unit 0 family inet address 8.8.8.1/24
set interfaces lo0 unit 0 family inet address 10.10.10.3/32
set routing-options static route 10.1.2.0/29 next-hop 10.2.3.2
deactivate routing-options static route 10.1.2.0/29
set routing-options static route 192.168.1.0/24 next-hop 10.1.3.1
deactivate routing-options static route 192.168.1.0/24
set routing-options static route 192.168.2.0/24 next-hop 10.2.3.2
deactivate routing-options static route 192.168.2.0/24
set routing-options router-id 10.10.10.3
set routing-options autonomous-system 30
set protocols bgp group EXT-AS-30 type external
set protocols bgp group EXT-AS-30 export ADV-TO-EBGP
set protocols bgp group EXT-AS-30 peer-as 12
set protocols bgp group EXT-AS-30 neighbor 10.1.3.1
set protocols bgp group EXT-AS-30 neighbor 10.2.3.2
set policy-options policy-statement ADV-TO-EBGP term DIRECT from protocol direct
set policy-options policy-statement ADV-TO-EBGP term DIRECT then accept
set policy-options policy-statement EXT-NET term 1 from protocol direct
set policy-options policy-statement EXT-NET term 1 from interface em3.0
set policy-options policy-statement EXT-NET term 1 from interface em4.0
set policy-options policy-statement EXT-NET term 1 from interface em5.0
set policy-options policy-statement EXT-NET term 1 then metric 200
set policy-options policy-statement EXT-NET term 1 then accept


###############################
Pengecekan :

lab@JunOS-03> show bgp summary
Groups: 1 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                12          5          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
10.1.3.1                 12         77         72       0       0       33:08 3/6/6/0              0/0/0/0
10.2.3.2                 12         82         80       0       0       36:39 2/6/6/0              0/0/0/0

lab@JunOS-01> show bgp summary
Groups: 2 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                13          6          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
10.1.3.3                 30         71         78       0       0       33:33 6/7/7/0              0/0/0/0
10.10.10.2               12         89         90       0       0       40:33 0/6/6/0              0/0/0/0


lab@JunOS-02> show bgp summary
Groups: 2 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                13          6          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
10.2.3.3                 30         82         85       0       0       37:20 6/7/7/0              0/0/0/0
10.10.10.1               12         91         90       0       0       40:48 0/6/6/0              0/0/0/0

lab@JunOS-03> show route receive-protocol bgp 10.1.3.1

inet.0: 18 destinations, 25 routes (18 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 10.1.2.0/29             10.1.3.1                                12 I
  10.1.3.0/29             10.1.3.1                                12 I
* 10.10.10.1/32           10.1.3.1                                12 I
  10.10.10.2/32           10.1.3.1             1                  12 I
* 192.168.1.0/24          10.1.3.1                                12 I
  192.168.2.0/24          10.1.3.1             2                  12 I

lab@JunOS-01> show route receive-protocol bgp 10.1.3.3

inet.0: 16 destinations, 23 routes (16 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.1.1.0/24              10.1.3.3                                30 I
* 2.2.2.0/24              10.1.3.3                                30 I
* 3.3.3.0/24              10.1.3.3                                30 I
  10.1.3.0/29             10.1.3.3                                30 I
* 10.2.3.0/29             10.1.3.3                                30 I
* 10.10.10.3/32           10.1.3.3                                30 I
* 192.168.3.0/24          10.1.3.3                                30 I




















Wednesday, May 23, 2018

Install dan Konfigurasi Tacacs+ pada Ubuntu 16.04 LTS

Install tacacs+
##apt-get install tacacs+

jika sudah selesai install kemudian cek apakah sudah jalan servicenya tacacs+
##ps -ef  | grep tac_plus
root@tacacs1:/home/snev# ps -ef | grep tac_plus
root      1075     1  0 22:53 ?        00:00:00 /usr/sbin/tac_plus -C /etc/tacacs+/tac_plus.conf
root      1243  1211  0 23:08 pts/0    00:00:00 grep --color=auto tac_plus

sebelum kita otak atik config tacacs+ baiknya di backup dahulu config default
##cp /etc/tacacs+/tac_plus.conf /etc/tacacs+/tac_plus.conf.BACKUP

kemudian kita buat tac log nya dahulu
##touch /var/log/tac_plus.acct


Thursday, May 3, 2018

Command Linux as SysAdmin



Top 10 Memory Consuming Process

ps -auxf | sort -nr -k 4 | head -10

Show Us Top 10 CPU Consuming Process

ps -auxf | sort -nr -k 3 | head -10