Archive for July, 2014

BGP ECMP VS BGP best & advertised route

BGP ECMP can have multi bgp routes be installed in the routing table;

but only ONE bgp route will be choose as the BEST and ACTIVE bgp route, and advertised to eligible neighbors!!

All other equal cost bgp routes, although installed in the routing table, it will not be advertised.

If multi routes should be installed && advertised, then “ADD PATH” feature should be enabled and used.

Advertisements

Leave a comment

Useful command: traffic capture on interface level and show compare the rollback difference

1. how to capture the traffic on the interface level on MX devices?
A: run monitor traffic interface xe-2/3/0 no-resolve

2. how to check the rollback compare:
show | compare rollback 5

XXXXXXXXXXXX#how | compare rollback 5
[edit interfaces xe-2/3/0 unit 0 family inet]
– address 192.168.101.1/24;
[edit routing-options static]
route 0.0.0.0/0 { … }
+ route 10.236.0.0/16 discard;
[edit policy-options policy-statement default-to-arista term 10 from]
route-filter 0.0.0.0/0 exact { … }
+ route-filter 10.236.0.0/16 exact;
[edit]

Leave a comment

python

tuple and list:
元组和列表十分类似,只不过元组和字符串一样是 不可变的 即你不能修改元组。元组通过圆 括号中用逗号分割的项目定义。元组通常用在使语句或用户定义的函数能够安全地采用一组值 的时候,即被使用的元组的值不会改变。

zoo=(“wolf”,”elephant”,”penguin”)
print “the number of animals in the zoo is”, len(zoo)
new_zoo =(“monkey”,”dolphin”,zoo)
print “number of animals in the new_zoo is”, len (new_zoo)
print “all animals in the new_zoo is “, new_zoo
print “animals bring from the old zoo is “, new_zoo[2]
print “last animal in the old zoo is “, new_zoo[2][2]
del zoo[2]
print zoo
print new_zoo

Python会从上往下执行,不会预先检查;

python tuple 不支持删除,不可修改。list 可以

list使用 [], tuple 使用()

error message of the above is:

the number of animals in the zoo is 3
number of animals in the new_zoo is 3
all animals in the new_zoo is (‘monkey’, ‘dolphin’, (‘wolf’, ‘elephant’, ‘penguin’))
animals bring from the old zoo is (‘wolf’, ‘elephant’, ‘penguin’)
last animal in the old zoo is penguin
Traceback (most recent call last):
File “C:/Python27/test/using_tuple.py”, line 14, in <module>
del zoo[2]
TypeError: ‘tuple’ object doesn’t support item deletion

Leave a comment

load-ballancing per-flow

for bgp route/traffic, first enable the multipath in the bgp group:
set protocol bgp grou x multipath,

then multi bgp routes will be installed in the routing table. but at the very beginning, only one will be used/selected to forward traffic.

we need to define a load ballance policy to do per-packet (actually per flow load ballancing)

term 10 {
then {
load-balance per-packet;
}
}

then export this to routing-options forwarding-table.

Leave a comment