Τα χρονικά του AWMN routing crash
By acoul on Thursday, November 5 2009, 11:29 - AWMN - Permalink
Το πρόβλημα τελικά εντοπίστηκε σε λάθος configuration confed BGP από τον enaon. Ηθικό δίδαγμα: τα confederations βλάπτουν σοβαρά ειδικά όταν υλοποιούνται από κόσμο που δεν γνωρίζει/κατέχει/νοιάζεται κλπ. Ακολουθούν κάποια κομμάτια από το forum του AWMN.
Δημοσίευση από enaon την Πέμ Οκτ 29, 2009 3:29 pm
Κάτι γίνετε παιδιά σίγουρα, μοιάζει με τα προβλήματα που είχαμε παλιά, κάτι στο bgp κάνει τα μηχανάκια που δεν έχουν quagga να μην συνδέουν τα peers τους, με αποτέλεσμα να μην δουλεύει τίποτα, διότι και αυτά που έχουν quagga μετά από άπειρα disconects διαλύονται.
Νομίζω ο καταλληλότερος είναι ο acinonyx να μας πει τι φταίει.
Δημοσίευση από enaon την Πέμ Οκτ 29, 2009 7:17 pm ok πήρα ένα debug απο το μηχανάκι του 7pbm.
route,bgp,debug,packet,raw Sent UPDATE message in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw RemoteAddress=10.19.180.233 in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw Length=63 in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw 00 3F 02 00 00 00 24 40 01 01 00 40 02 16 02 08 in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw 39 F3 12 96 09 4B 03 91 13 47 0C 26 10 F7 27 9B in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw 03 01 11 47 40 03 04 0A 13 B4 EA 18 0A 54 EC in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet Sent UPDATE message in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet RemoteAddress=10.19.180.233 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet Length=63 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet UPDATE Message in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet RemoteAddress=10.19.180.130 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet MessageLength=78 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw Received UPDATE packet in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw RemoteAddress=10.19.180.130 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw Length=78 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 00 4E 02 00 00 00 33 40 01 01 00 40 02 1E 02 07 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 00 00 12 96 00 00 0E 51 00 00 24 48 00 00 32 0D in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 00 00 04 A5 00 00 2B D8 00 00 00 37 40 03 04 0A in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 13 B4 E1 40 05 04 00 00 00 64 18 0A 15 8A in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet PathAttributes in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet bgp-origin=IGP in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet bgp-as-path=4758,3665,9288,12813,1189,11224,55 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet bgp-as-path-len=7 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet bgp-localpref=100 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet NLRI=10.21.138.0/24 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw Sent UPDATE message in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw RemoteAddress=10.19.180.233 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw Length=55 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 00 37 02 00 00 00 1C 40 01 01 00 40 02 0E 02 06 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 39 F3 12 96 09 4B 00 26 04 28 0A B6 40 03 04 0A in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 13 B4 EA 18 0A 13 95 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet Sent UPDATE message in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet RemoteAddress=10.19.180.233 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet Length=55 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet NOTIFICATION Message in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet RemoteAddress=10.19.180.233 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet MessageLength=21 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw Received NOTIFICATION packet in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw RemoteAddress=10.19.180.233 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw Length=21 in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet,raw 00 15 03 03 0B in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,error Received notification in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,error UPDATE error: malformed AS_PATH in 29-Oct 19:4:55.68 from 10.19.180.234 route,bgp,debug,state Entering Idle state in 29-Oct 19:4:55.68 from 10.19.180.234
Δημοσίευση από enaon την Πέμ Οκτ 29, 2009 8:26 pm
Με παράδειγμα το ποστ του Βασίλη που ανέλυσε το bgp πακέτο, βλέπουμε ότι το τελευταίο πακέτο πριν το λάθος έρχεται απο εδώ:
14835 4758 2379 38 1064 2742 10.19.149.0 oulopasta (#2742)
Τον ξέρει κανείς;
Δημοσίευση από enaon την Πέμ Οκτ 29, 2009 9:05 pm
Λάθος έκανα, ο 4423 φταίει, το πρώτο πακέτο απο το log, στέλνει ΑS_CONFED_SEQUENCE segment, ακριβώς όπως παλιά. Μπορεί να τον βρει κάποιος;
route,bgp,debug,packet,raw 03 01 11 47 40 03 04 0A 13 B4 EA 18 0A 54 EC in 29-Oct 19:4:55.67 from 10.19.180.234
δηλαδή : Δεύτερο segment
0x03 AS_CONFED_SEQUENCE segment 0x01 Μήκος 1 AS (= 2 bytes) 0x1147 AS 4423''
Έτσι ο Σωτήρης το εντόπισε μια και ο Βασίλης (acinonyx) κάπου έτρεχε εκείνες τις μέρες … Αυτό είναι το AWMN, 800 backbone κόμβοι, 10.000+ ενδιαφερόμενοι και 2 - 3 που γνωρίζουν και κατέχουν τα του routing, wifi, radio κλπ.
Ακολουθεί σχετικό brainstorming για το πως συνέβει, γιατί διαδόθηκε αντί να φιλτραριστεί και τελικά έριξε όλο το δίκτυο:
Δημοσίευση από enaon την Παρ Οκτ 30, 2009 3:59 pm
Παιδιά πλάκα κάνουμε ; :) Ακόμα ψάχνουμε τί φταίει; Θα το γράψω πιο ωραία μπας και μας πείσει..
Πακέτο από τον δρομολογητή του 7pbm:
route,bgp,debug,packet,raw Length=63 in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw 00 3F 02 00 00 00 24 40 01 01 00 40 02 16 02 08 in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw 39 F3 12 96 09 4B 03 91 13 47 0C 26 10 F7 27 9B in 29-Oct 19:4:55.66 from 10.19.180.234 route,bgp,debug,packet,raw 03 01 11 47 40 03 04 0A 13 B4 EA 18 0A 54 EC in 29-Oct 19:4:55.67 from 10.19.180.234 route,bgp,debug,packet Sent UPDATE message in 29-Oct 19:4:55.67 from 10.19.180.234
Ανάλυση με βάση το παλιό ποστ του acinonyx:
Πακέτο BGP
0x003f 63 bytes μέγεθος πακέτου 0x02 Το μήνυμα είναι UPDATE 0x0000 Καμία διαδρομή δεν αποσύρεται 0x0024 Ολικό μήκος attributes ( 36 bytes)
Πρώτο attribute
0x40 Έκδοση BGPv4 0x01 Origin attribute 0x01 Μήκος 1 byte 0x00 Προέρχεται από iBGP
Δεύτερο attribute
0x40 Έκδοση BGPv4 0x02 AS Path attribute 0x16 Μήκος 22 byte
Πρώτο segment
0x02 AS_SEQUENCE segment 0x08 Μήκος 8 AS (= 16 bytes) 0x39F3 AS 14835 0x1296 AS 4758 0x094B AS 2379 0x0391 AS 913 0x1347 AS 3665 0x0C26 AS 3110 0x10F7 AS 4343 0x279B AS 10139
Δεύτερο segment
0x03 AS_CONFED_SEQUENCE segment 0x01 Μήκος 1 AS (= 2 bytes) 0x1147 AS 4423
Τρίτο attribute 18 0A 54 EC
0x40 Έκδοση BGPv4 0x03 Nexthop attribute 0x04 Μήκος 4 byte 0x0A489BFE Επόμενο hop = 10.19.180.234
Διαδρομή
0x18 Prefix /24 0x0A565C Δίκτυο 10.84.236(.0)
Το δεύτερο segment του AS_PATH είναι λάθος! Ο 4423 διαφημίζει AS_CONFED_SEQUENCE σε γείτονες που δεν βρίσκονται στο confederation.
Υπό φυσιολογικές συνθήκες όμως δεν μπορεί να δημιουργηθεί αυτό το πρόβλημα. Συμβαίνει επειδή ο maragos (4423) προφανώς έχει αμελήσει να ενημερώσει το configuration του BGP του.”
Δημοσίευση από Acinonyx την Δευτ Νοέμ 26, 2007 9:30 pm
Χαλάρωσε. Δεν είπε κανείς ότι η quagga είναι τέλεια. Αυτό που λέμε είναι ότι και να έχει όμως μπορούμε να το διορθώσουμε.
Ας δούμε στο παραπάνω πακέτο:
Πακέτο BGP
0x0045 45 bytes μέγεθος πακέτου 0x02 Το μήνυμα είναι UPDATE 0x0000 Καμία διαδρομή δεν αποσύρεται 0x042 Ολικό μήκος attributes
Πρώτο attribute
0x40 Έκδοση BGPv4 0x01 Origin attribute 0x01 Μήκος 1 byte 0x00 Προέρχεται από iBGP
Δεύτερο attribute
0x40 Έκδοση BGPv4 0x02 AS Path attribute 0x1C Μήκος 28 byte
Πρώτο segment
0x02 AS_SEQUENCE segment 0x0B Μήκος 11 AS (= 22 bytes) 0x3007 AS 12295 0x229F AS 88630 0x1318 AS 4888 0x2448 AS 9288 0x0E51 AS 3665 0x090B AS 2315 0x094B AS 2379 0x0391 AS 913 0x10F6 AS 4342 0x25F2 AS 9714 0x0C3C AS 3132
Δεύτερο segment
0x03 AS_CONFED_SEQUENCE segment 0x01 Μήκος 1 AS (= 2 bytes) 0x1BA9 AS 7081
Τρίτο attribute
0x40 Έκδοση BGPv4 0x03 Nexthop attribute 0x04 Μήκος 4 byte 0x0A489BFE Επόμενο hop = 10.72.155.254
Διαδρομή
0x18 Prefix /24 0x0A565C Δίκτυο 10.86.92(.0)
Το δεύτερο segment του AS_PATH είναι λάθος! Ο 7081 διαφημίζει AS_CONFED_SEQUENCE σε γείτονες που δεν βρίσκονται στο confederation.
Ας δούμε τον router του vmanolis:
BGP neighbor is 10.80.194.146, remote AS 7081, local AS 3132, external link Description: tsio01 BGP version 4, remote router ID 10.86.92.129 BGP state = Established, up for 3d09h07m Last read 00:00:07, hold time is 30, keepalive interval is 10 seconds Configured hold time is 30, keepalive interval is 10 seconds Neighbor capabilities: Dynamic: advertised and received Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Received 68079 messages, 0 notifications, 0 in queue Sent 95228 messages, 2 notifications, 0 in queue Route refresh request: received 3, sent 3 Minimum time between advertisement runs is 30 seconds For address family: IPv4 Unicast AF-dependant capabilities: Outbound Route Filter (ORF) type (64) Prefix-list: Send-mode: advertised, received Receive-mode: advertised, received Outbound Route Filter (ORF) type (128) Prefix-list: Send-mode: advertised, received Receive-mode: advertised, received Outbound Route Filter (ORF): sent; received (3 entries) Inbound soft reconfiguration allowed Community attribute sent to this neighbor(both) Inbound path policy configured Outbound path policy configured Incoming update prefix filter list is *awmn-bgp Outgoing update AS path filter list is *maxaslength 1 accepted prefixes Connections established 3; dropped 2 Last reset 3d09h09m, due to BGP Notification send Local host: 10.80.194.145, Local port: 1585 Foreign host: 10.80.194.146, Foreign port: 179 Nexthop: 10.80.194.145 Read thread: on Write thread: off
Όπως βλέπουμε ο vmanolis έχει δηλώσει τον tsio01 ως eBGP peer με remote-as 7081.
Ας δούμε στον Tsio01:
BGP neighbor is 10.80.194.145, remote AS 3132, local AS 7081, external link Description: vmanolis BGP version 4, remote router ID 10.80.194.129 Neighbor under common administration BGP state = Established, up for 3d09h10m Last read 00:00:08, hold time is 30, keepalive interval is 10 seconds Configured hold time is 30, keepalive interval is 10 seconds Neighbor capabilities: Dynamic: advertised and received Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Received 93957 messages, 0 notifications, 0 in queue Sent 67042 messages, 0 notifications, 0 in queue Route refresh request: received 1, sent 1 Minimum time between advertisement runs is 30 seconds For address family: IPv4 Unicast AF-dependant capabilities: Outbound Route Filter (ORF) type (64) Prefix-list: Send-mode: advertised, received Receive-mode: advertised, received Outbound Route Filter (ORF) type (128) Prefix-list: Send-mode: advertised, received Receive-mode: advertised, received Outbound Route Filter (ORF): sent; received (3 entries) Inbound soft reconfiguration allowed Community attribute sent to this neighbor(both) Inbound path policy configured Outbound path policy configured Incoming update prefix filter list is *awmn-bgp Outgoing update AS path filter list is *maxaslength 312 accepted prefixes Connections established 1; dropped 0 Last reset never Local host: 10.80.194.146, Local port: 179 Foreign host: 10.80.194.145, Foreign port: 1585 Nexthop: 10.80.194.146 Read thread: on Write thread: off
Ο Tsio01 έχει όμως τον vmanolis ως confederation peer και έτσι συνδέονται! Ο tsio01 νομίζει ότι στέλνει update σε confederation peer και στέλνει το AS_CONFED_SEQUENCE πιστεύοντας ότι ο vmanolis θα το αντικαταστήσει με το confed id όταν βγει έξω από το confed. Έλα ντε όμως που αυτό δε γίνεται ποτέ λόγω του γνωστού bug της quagga. Αν λειτουργούσε ο έλεγχος του AS_PATH για AS_CONFED_SEQUENCEs στην quagga (βλέπε παραπάνω patch) ο vmanolis δε θα δεχόταν κανένα Update από τον tsio01. Είναι το ίδιο πρόβλημα με το prepend στα confeds αλλά με διαφορετικό τρόπο εκδήλωσης.
Υπό φυσιολογικές συνθήκες όμως δεν μπορεί να δημιουργηθεί αυτό το πρόβλημα. Συμβαίνει επειδή ο tsio01 προφανώς έχει αμελήσει να ενημερώσει το configuration του BGP του.
Δημοσίευση από Acinonyx την Δευτ Νοέμ 26, 2007 9:36 pm
Ορίστε και το malformed AS_PATH με bold
__OpenWrt> show ip bgp 10.86.92.0 BGP routing table entry for 10.86.92.0/24 Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to non peer-group peers: 10.2.16.86 10.2.16.110 10.34.61.233 (1084) 2581 10853 6695 8000 3132 (7081) 10.2.32.100 (metric 1) from 10.2.16.78 (10.2.32.1) Origin IGP, localpref 100, valid, confed-external, best Last update: Mon Nov 26 13:10:14 2007
(7588) 3990 7051 7284 7578 10853 10.2.92.138 (metric 1) from 10.2.16.86 (10.2.92.1) Origin IGP, localpref 100, valid, confed-external Last update: Mon Nov 26 00:00:03 2007__
Και το patch για την quagga:
ftp://ftp.acinonyx.awmn/quagga/patches/quagga-0.98.6-confed-errorhandle.diff.gz
Δημοσίευση από Vigor την Δευτ Οκτ 01, 2007 9:35 am
enaon έγραψε: Αν δεν βαριέσαι δες αν είναι πιθανό να στέλνουν οι quagga confed info και να επηρεάζει τον τρόπο εφαρμόζει τον κανονισμό η mtik, αν με το malformed εννοεί confed μηνύματα.
http://www.arin.net/reference/rfc/rfc1965.txt
Και εδώ επιβεβαιώνεσαι enaon:
RFC1965 έγραψε:Compatibility All BGP speakers participating in a confederation must recognize the AS_CONFED_SET and AS_CONFED_SEQUENCE segment type extensions to the AS_PATH attribute. Any BGP speaker not supporting these extensions will generate a notification message specifying an "UPDATE Message Error" and a sub- code of "Malformed AS_PATH". This compatibility issue implies that all BGP speakers participating in a confederation must support BGP confederations, however BGP speakers outside the confederation need not support these extensions.
Επίσης:
RFC5065 έγραψε:5. Error Handling A BGP speaker MUST NOT transmit updates containing AS_CONFED_SET or AS_CONFED_SEQUENCE attributes to peers that are not members of the local confederation. It is an error for a BGP speaker to receive an UPDATE message with an AS_PATH attribute that contains AS_CONFED_SEQUENCE or AS_CONFED_SET segments from a neighbor that is not located in the same confederation. If a BGP speaker receives such an UPDATE message, it SHALL treat the message as having a malformed AS_PATH according to the procedures of [BGP-4], Section 6.3 ("UPDATE Message Error Handling"). It is a error for a BGP speaker to receive an update message from a confederation peer that is not in the same Member-AS that does not have AS_CONFED_SEQUENCE as the first segment. If a BGP speaker receives such an UPDATE message, it SHALL treat the message as having a malformed AS_PATH according to the procedures of [BGP-4], Section 6.3 ("UPDATE Message Error Handling").
Δημοσίευση από Acinonyx την Σάβ Απρ 07, 2007 8:52 pm
manoskol έγραψε: οποτε τι κάνουμε? :( Βασίλη μπορεις να πατσάρεις την quagga? Εκτος και αν χρειαζεται επαληθευση με νέα δοκιμη….
Το πάλεψα…
Τί συμβαίνει ακριβως:
Η αφαίρεση της εσωτερικής δομής του AS_PATH_CONFED από το AS_PATH γίνεται λίγο πριν την αποστολή του πακέτου στον εξωτερικό γείτονα και ΜΕΤΑ το prepend. Ο μηχανισμός που χρησιμοποιείται μπορεί να λειτουργήσει μόνο όταν το AS είναι το τελευταίο μέρος του AS_PATH. Από τη στιγμή που γίνεται prepend κάποιο άλλο AS, ο μηχανισμός αφαίρεσης του AS_PATH_CONFED δεν λειτουργεί.
Είναι λίγο δύσκολο να διορθωθεί γιατί χρειάζεται πολλές αλλαγές σε διάφορα τμήματα του κώδικα.
Νομίζω όμως ότι υπάρχει όμως λύση! Θα υπάρχει το ίδιο αποτέλεσμα αν γίνει διπλό prepend στα in και out από τη μία πλευρα (όχι αυτή του confederation). Μπορεί να μην είναι αυτό που προτείνει η ciscο αλλά πρέπει να λειτουργεί.
Σε περίπτωση που και οι δύο πλευρές βρίσκονται σε διαφορετικά confederation, τότε μπορεί να γίνει route-map prepend in και από τις δύο αντί για out, με το ίδιο επιθυμιτό αποτέλεσμα.
Μπορεί κάποιος να το δοκιμάσει;”
Δημοσίευση από Acinonyx την Κυρ Νοέμ 01, 2009 6:42 pm
enaon έγραψε:Άντε ρε Βασίλη που είσαι :)
Το mikrtolinux έχει το patch σου τελικά το κοίταξα.
Το γεγονός έχει ώς εξής: Ένα μηχανάκι δικό μου κοιτάει ένα μηχανάκι του 7bpm. To δικό μου είναι 4beta4-quagga 0.98.6-acinonyx, του 7bpm ήταν 4.2, το κάναμε 4.1 και πάλι 4.2, χωρίς διαφορά στα παρακάτω.
Το peer μεταξύ μας είχε πέσει από το malformed του 4423. Το malformed o 7bpm το λάμβανε από το peer του με τον panoramix, που το έχει σε άλλο μηχανάκι ( πάλι 4.2 ). Όταν έκοβε το link του panoramix, τότε το δικό μας peer ( μαζί με άλλα ) συνερχόταν.
Το μοναδικό συμπέρασμα που μπορώ να βγάλω, είναι ότι ένα 4.2 του 7bpm περνούσε το malformed στο άλλο 4.2 του και μετά σε εμένα, που σημαίνει ότι τα 4.2 δεν παίζουν σωστά.
Μπορούμε να το δοκιμάσουμε κάπως εύκολα;
- Στήσε κάπου ένα 4.2 και φτιάξε ένα ipip tunnel:
interface ipip add name=serval local-address=router_ip_address remote-address=10.2.16.133 disabled=no ; ip address add address=172.16.1.2/24 broadcast=172.16.1.255 interface=serval
όπου router_ip_address = η IP διεύθυνση της ethernet του router
- Κάνε post την router_ip_address ώστε να στήσω κι εγώ το ipip από την πλευρά μου
- Ξεκίνα ένα BGP με AS 2 και φτιάξε ένα eBGP peer με IP 172.16.1.1 και remote-as 1
- Βάλε ένα ping να τρέχει ώστε να δεις αν σηκώθηκε το ipip
- Θα στέλνω ένα prefix το οποίο θα είναι malformed. Παρακολούθησε την αντίδραση του BGP του mikrotik.”
Δημοσίευση από enaon την Δευτ Νοέμ 02, 2009 1:27 am
Acinonyx έγραψε:
enaon έγραψε:
Στον Γ λαμβάνω αυτό:
3 ADb dst-address=172.16.2.0/24 gateway=172.16.20.1 interface=home-net gateway-state=reachable distance=20 scope=40 target-scope=10 bgp-as-path="2" bgp-origin=igp received-from=172.16.20.1
Έσβησε το AS_CONFED_SEQUENCE από το path ή είναι ιδέα μου; Αν πράγματι το έσβησε, τότε ποιος το έσβησε; Ο Β πριν το στείλει ή ο Γ αφού το έλαβε;
Πράγματι!! Πρέπει να μασήσω καμία τσίχλα, πολύ βιάζομαι :) Το 4.2 δεν τα σταματάει αλλά τα διορθώνει. Κάνει ότι έκανε το 2.8.26 νομίζω, που μοιάζει λογικό σύμφωνα με αυτά που γράφει εδώ,
Traina, et al. Standards Track [Page 6] RFC 5065 August 2007 c) When a given BGP speaker advertises the route to a BGP speaker located in a neighboring autonomous system that is not a member of the local confederation, the advertising speaker SHALL update the AS_PATH attribute as follows: 1) if any path segments of the AS_PATH are of the type AS_CONFED_SEQUENCE or AS_CONFED_SET, those segments MUST be removed from the AS_PATH attribute, leaving the sanitized AS_PATH attribute to be operated on by steps 2, 3 or 4. 2) if the first path segment of the remaining AS_PATH is of type AS_SEQUENCE, the local system prepends its own AS Confederation Identifier as the last element of the sequence (put it in the leftmost position with respect to the position of octets in the protocol message). If the act of prepending will cause an overflow in the AS_PATH segment (i.e., more than 255 ASs), it SHOULD prepend a new segment of type AS_SEQUENCE and prepend its own AS number to this new segment. 3) if the first path segment of the remaining AS_PATH is of type AS_SET, the local system prepends a new path segment of type AS_SEQUENCE to the AS_PATH, including its own AS Confederation Identifier in that segment. 4) if the remaining AS_PATH is empty, the local system creates a path segment of type AS_SEQUENCE, places its own AS Confederation Identifier into that segment, and places that segment into the AS_PATH.
που με έχει μπερδέψει γιατί είναι διαφορετικό απο αυτό που έει εδώ:
A BGP speaker MUST NOT transmit updates containing AS_CONFED_SET or AS_CONFED_SEQUENCE attributes to peers that are not members of the local confederation. It is an error for a BGP speaker to receive an UPDATE message with an AS_PATH attribute that contains AS_CONFED_SEQUENCE or AS_CONFED_SET segments from a neighbor that is not located in the same confederation. If a BGP speaker receives such an UPDATE message, it SHALL treat the message as having a malformed AS_PATH according to the procedures of [BGP-4], Section 6.3 ("UPDATE Message Error Handling").
Τώρα έχω quagga patched σε mt3.30 στον Γ, και βλέπω αυτά:
bbr-bliz1# show running-config Current configuration: ! hostname bbr-bliz1 password awmn enable password *** ! router bgp 3 bgp router-id 172.16.20.2 neighbor awmn peer-group neighbor awmn timers 10 30 neighbor awmn capability dynamic neighbor awmn soft-reconfiguration inbound neighbor 172.16.20.1 remote-as 2 neighbor 172.16.20.1 peer-group awmn ! line vty ! end bbr-bliz1# sh bbr-bliz1# show ip bbr-bliz1# show ip bg bbr-bliz1# show ip bgp su bbr-bliz1# show ip bgp summary BGP router identifier 172.16.20.2, local AS number 3 1 BGP AS-PATH entries 0 BGP community entries Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxR cd 172.16.20.1 4 2 4 12 0 0 0 00:00:30 1 Total number of neighbors 1 bbr-bliz1# show ip bgp rou bbr-bliz1# show ip bgp attribute-info cidr-only community community-info community-list dampened-pa ths filter-list flap-statistics ipv4 neighbors paths prefix-list regexp route-map rsclient scan summary view vpnv4 bbr-bliz1# show ip bgp BGP table version is 0, local router ID is 172.16.20.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.2.0/24 172.16.20.1 0 2 i Total number of prefixes 1 bbr-bliz1# sh bbr-bliz1# show ve bbr-bliz1# show version Quagga 0.98.6-acinonyx (bbr-bliz1). Copyright 1996-2005 Kunihiro Ishiguro, et al. bbr-bliz1#
Δημοσίευση από Acinonyx την Δευτ Νοέμ 02, 2009 2:16 am
Όχι, απαγορεύεται να πειράξει segment αλλουνού router στο AS_PATH γιατί κινδυνεύει να δημιουργηθεί routing loop. Πρέπει να το σταματήσει και όχι να το «διορθώσει».
When implementing BGP confederations, Section 5.1.2 of BGP-4 is replaced with the following text:
Οι κανόνες αυτοί του RFC5065 εφαρμόζονται όταν ο router συμμετέχει σε confederation, όχι γενικά. Γενικά ισχύουν οι κανόνες του RFC1771.
Παρακάτω γράφει και για το error handling:
It is an error for a BGP speaker to receive an UPDATE message with an AS_PATH attribute that contains AS_CONFED_SEQUENCE or AS_CONFED_SET segments from a neighbor that is not located in the same confederation. If a BGP speaker receives such an UPDATE message, it SHALL treat the message as having a malformed AS_PATH according to the procedures of [BGP-4], Section 6.3 ("UPDATE Message Error Handling").
Έχω την υποψία ότι οι developers του mikrotik έχουν θεωρήσει εσφαλμένα ότι το να σβήνουν το τελευταίο AS_CONFED_* σε οποιαδήποτε περίπτωση υπερκαλύπτει την απαίτηση του RFC5065. Αυτό όμως είναι λάθος και σπάει το loop detection του BGP. Για κάθε σβήσιμο AS_CONFED_* segment πρέπει να προστίθεται στο τέλος ένα CONFED_ID ώστε αν τυχόν το prefix αυτό ξαναμπει μέσα στο confederation να απορριφθεί και να μην δημιουργηθεί loop..