3TC
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # NRP - TP 3 & 4 - BGP ###### tags: `NRP` `S2` ### basic config ![](https://i.imgur.com/F1Xt2D7.png) Pour configurer un router : - clic-droit sur le router - start - console - configuration comme un routeur cisco Pour mettre en configuration ipv6 > conf t > ipv6 unicast-routing pour chaque interface faire >Router(config)# interface name number >Router(config-if)# ipv6 enable >Router(config-if)# ipv6 address ipv6-address/prefix-length >Router(config-if)# no shutdown Lors de la configuration de BGP on utilise les commandes >neighbor _ipv6-address_ remote-as _as-number_ et >neighbor _ipv6-address_ activate __NB__ : Les ip utilisée (Global-unicast) et as-number sont toujours ceux du routeur sur lequel on veut se connecter **Can a router establish a BGP session that has not been manually configured on the router? Why?** No ? On ne veut pas que les routeurs se connectent tous car ils n'appartiennent pas forcément aux mêmes entreprises ## Part 5: BGP Peering ### 5.1 What packets related to BGP do you see on Wireshark? When activating the connection between R2 and R3 we can see some BGP messages : - OPEN - KEEPALIVE - UPDATE What packets related to BGP do you see on Wireshark? ![](https://i.imgur.com/AIMwKD6.png) BGP établie sa connection en TCP Quand on ne configure qu'un routeur le paquet reçu est supprimé ([RST, ACK]) Dès qu'on configure le deuxième routeur le paquet TCP contenant BGP ouvre une connection (Classique SYN, SYN-ACK, ACK) ### 5.2 What information is exchanged between the two BGP routers? __Open message :__ On y trouve des infos comme le `as-number` ou le `hold-time` (= le temps sans recevoir de message update ou keepalive avant de tuer la connection) __Update message:__ On ne trouve aucune information tant qu'aucun autre chemin n'a été configuré. Avec wireshark le champ `Withdraw Routes Length` est égal à 0 car le `Network statement` (= statement qui indique le network possédé) n'est pas encore configuré. ### 5.3 Which packets are sent regularly and why? How often? Where can you find this information? We can see on wireshark KEEPALIVE packets are send oftenly. __wikipedia__ : KEEPALIVE maintient la session ouverte. Par défaut le message KEEPALIVE est envoyé toutes les 30 secondes, et un délai de 90 secondes sans message UPDATE ni KEEPALIVE reçu entraîne la fermeture de la session ### 5.5 What are the states that a BGP session can have? Explain what each of them means. Idle Connect Active OpenSent OpenConfirm Established ![](https://i.imgur.com/C59vH2F.png) Plus de doc: `https://fr.wikipedia.org/wiki/Border_Gateway_Protocol#Machine_d'%C3%A9tats_finis_de_BGP` ### 5.6 What is the state of the BGP session on R2 / R3? Established ### 5.7 Can you ping R3 from R1? Why? ```cisco R1#ping 2001:100:4:3::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:100:4:3::2, timeout is 2 seconds: % No valid route for destination Success rate is 0 percent (0/1) R1# ``` Ils sont dans deux réseaux differents et pour l'instant aucun des routeurs n'a publié des adresses reseaux ( cf questions suivantes ) No routes are set up to allow R2 to transit traffic. Hence the need for BGP __Ping R2 from LAN1__ Nothing changed, no route to destination. #### 5.7.2 Look at the BGP table on the router R2 (`show bgp ipv6 unicast`) . What does it show? We can see the prefixes that have been propagated by BGP, with the AS path ```cisco R2#show bgp ipv6 unicast BGP table version is 5, local router ID is 2.2.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *> 2001:100:1:1::/64 2001:100:4:1::2 0 0 101 i *> 2001:100:1:2::/64 2001:100:4:3::2 0 103 104 i *> 2001:100:4:1::/64 :: 0 32768 i *> 2001:100:4:2::/64 2001:100:4:3::2 0 0 103 i R2# ``` ``` Network Next Hop Metric LocPrf Weight Path *> 2001:100:1:1::/64 2001:100:4:1::2 0 0 111 i *> 2001:100:1:2::/64 2001:100:4:3::2 0 113 114 i *> 2001:100:4:1::/64 :: 0 32768 i * 2001:100:4:1::2 0 0 111 i *> 2001:100:4:2::/64 2001:100:4:3::2 0 0 113 i * 2001:100:4:3::/64 2001:100:4:3::2 0 0 113 i *> :: 0 32768 i ``` This time, nexthops are specified with their link-local IPv6 addresses. ```cisco R2#show ipv6 route bgp IPv6 Routing Table - default - 8 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, H - NHRP, I1 - ISIS L1 I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination NDr - Redirect, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1 OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2, l - LISP B 2001:100:1:1::/64 [20/0] -> distance=20 via FE80::C801:35FF:FE1E:38, GigabitEthernet2/0 B 2001:100:1:2::/64 [20/0] via FE80::C803:35FF:FE1E:1C, GigabitEthernet1/0 B 2001:100:4:2::/64 [20/0] via FE80::C803:35FF:FE1E:1C, GigabitEthernet1/0 R2# ``` #### 5.7.3 Look at the BGP routing table on the router R2. Are there any BGP routes? What is the administrative distance of BGP? What does it mean? The administrative distance of BGP is 20 as shown in the [20/0] after the ip in the routes. https://www.cisco.com/c/fr_ca/support/docs/ip/border-gateway-protocol-bgp/15986-admin-distance.pdf #### 5.7.4 Physically unplug the link between R2 and R3. How long does it take for destinations within AS1Z1 to disappear from the routing table of R1? Plug the link back in, how long does it take for R1to recover its forwarding state for destinations within AS 1Z1? It takes approximately 180s to disappear, and about 10-20s to come back. ## Part 6: BGP Filtering **Partie cours** https://networklessons.com/cisco/ccnp-route/introduction-to-route-maps les infos sont ici Si qq peut résumer ### 6.1 Yes, all of them. ``` R2#show ipv6 route IPv6 Routing Table - default - 16 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, H - NHRP, I1 - ISIS L1 I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination NDr - Redirect, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1 OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2, l - LISP B 2001:100:1:1::/64 [20/0] via FE80::C803:1FFF:FED7:1C, GigabitEthernet1/0 B 2001:100:1:2::/64 [20/0] via FE80::C802:20FF:FE4D:0, FastEthernet0/0 B 2001:100:1:11::/64 [20/0] via FE80::C803:1FFF:FED7:1C, GigabitEthernet1/0 B 2001:100:1:12::/64 [20/0] via FE80::C803:1FFF:FED7:1C, GigabitEthernet1/0 B 2001:100:1:13::/64 [20/0] via FE80::C803:1FFF:FED7:1C, GigabitEthernet1/0 B 2001:100:1:41::/64 [20/0] via FE80::C802:20FF:FE4D:0, FastEthernet0/0 B 2001:100:1:42::/64 [20/0] via FE80::C802:20FF:FE4D:0, FastEthernet0/0 B 2001:100:1:43::/64 [20/0] via FE80::C802:20FF:FE4D:0, FastEthernet0/0 C 2001:100:4:1::/64 [0/0] via GigabitEthernet1/0, directly connected L 2001:100:4:1::1/128 [0/0] via GigabitEthernet1/0, receive B 2001:100:4:2::/64 [20/0] via FE80::C802:20FF:FE4D:0, FastEthernet0/0 C 2001:100:4:3::/64 [0/0] via FastEthernet0/0, directly connected L 2001:100:4:3::1/128 [0/0] via FastEthernet0/0, receive B 2001:200:200:201::/64 [20/0] via FE80::C803:1FFF:FED7:1C, GigabitEthernet1/0 B 2001:200:200:204::/64 [20/0] via FE80::C802:20FF:FE4D:0, FastEthernet0/0 L FF00::/8 [0/0] via Null0, receive ``` ### 6.2 pour créer une access-list `conf t` `ipv6 access-list *name-acl*` `Router(config-ipv6-acl)#{permit ou deny}<ipv6-source-prefix> <ipv6-dest-prefix>` Dans cet exemple on prend la source 2001:200:200:201::/64 et la destination any config sur le router R1 ``` interface FastEthernet0/0 no ip address duplex full ipv6 address 2001:100:1::1/64 ipv6 address 2001:100:1:1::1/64 ipv6 address 2001:100:1:11::1/64 ipv6 address 2001:100:1:12::1/64 ipv6 address 2001:100:1:13::1/64 ipv6 address 2001:200:200:201::1/64 ipv6 enable ! interface GigabitEthernet1/0 no ip address negotiation auto ipv6 address 2001:100:4:1::2/64 ! interface GigabitEthernet2/0 no ip address shutdown negotiation auto ! router bgp 11 bgp router-id 1.1.1.1 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 2001:100:4:1::1 remote-as 12 ! address-family ipv4 exit-address-family ! address-family ipv6 network 2001:100:1:1::/64 network 2001:100:1:11::/64 network 2001:100:1:12::/64 network 2001:100:1:13::/64 network 2001:100:4:1::/64 network 2001:200:200:201::/64 neighbor 2001:100:4:1::1 activate neighbor 2001:100:4:1::1 route-map mapdeny201 out exit-address-family ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! ! route-map mapdeny201 deny 10 match ipv6 address deny201 ! ! ! ipv6 access-list deny201 permit ipv6 2001:200:200:201::/64 any ! ``` ### 6.3 `R2#clear bgp ipv6 unicast *` ``` router bgp 12 bgp router-id 2.2.2.2 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 2001:100:4:1::2 remote-as 11 neighbor 2001:100:4:3::2 remote-as 13 ! address-family ipv4 exit-address-family ! address-family ipv6 network 2001:100:4:1::/64 network 2001:100:4:3::/64 neighbor 2001:100:4:1::2 activate neighbor 2001:100:4:1::2 route-map mapdeny201 in neighbor 2001:100:4:3::2 activate exit-address-family ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! ! route-map mapdeny201 deny 10 match ipv6 address deny201 ! route-map mapdeny201 permit 20 match ipv6 address base ! ! ! ipv6 access-list base permit ipv6 any any ! ipv6 access-list deny201 permit ipv6 2001:200:200:201::/64 any ! ``` ## Part 7: Filtering in function of the AS_PATH ### 7.1 sans bgp R1-R4 ``` R1#show ipv6 route 2001:200:200:204:: Routing entry for 2001:200:200:204::/64 Known via "bgp 11", distance 20, metric 0, type external Route count is 1/1, share count 0 Routing paths: FE80::C801:1FFF:FEB6:1C, GigabitEthernet1/0 MPLS label: nolabel Last updated 00:01:02 ago ``` avec bgp R1-R4 ``` R1#show ipv6 route 2001:200:200:204::/64 Routing entry for 2001:200:200:204::/64 Known via "bgp 11", distance 20, metric 0, type external Route count is 1/1, share count 0 Routing paths: FE80::C804:1FFF:FEE7:38, GigabitEthernet2/0 MPLS label: nolabel Last updated 00:01:44 ago ``` ### 7.3 sans bgp ``` R3#show ipv6 route 2001:100:1:1::/64 Routing entry for 2001:100:1:1::/64 Known via "bgp 13", distance 20, metric 0, type external Route count is 1/1, share count 0 Routing paths: FE80::C801:1FFF:FEB6:0, FastEthernet0/0 MPLS label: nolabel Last updated 00:23:19 ago ``` pas de changement avec bgp

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully