Intrvw: Difference between revisions

1,388 bytes added ,  2 years ago
Line 181:
How to check traffic requests coming per second? netstat -s, ss -s, tcpdump
 
= AMZN Sydney NDE =
 
;Round 1
Line 290:
 
Captures on Switch, what will be Source & Dest IP as well as MAC?
 
= AMZN NDE =
 
<pre>
Q: Write a function to verify if a given set of interfaces is present as next-hops for a given prefix in router's routing table.
Task:
* Implement function: check_prefix_next_hops("router-1", "216.182.232.249/32", ["bond1", "bond3"])
* Function must return True/False
* Use example router output from MOCKED_DEVICE_DATA object
MOCKED_DEVICE_DATA = {
"router-1": """
B>* 216.182.232.249/32 [200/0] via 100.92.0.1, bond1, 00:14:14
* via 100.92.0.3, bond3, 00:14:14
C>* 253.4.0.232/31 is directly connected, jrp2-1
B> 30.0.0.0/8 [200/0] via 100.92.188.32 (recursive), 00:00:25
* via 100.92.64.3, bond2, 00:00:25
via 100.92.188.64 (recursive), 00:00:25
* via 100.92.64.5, bond3, 00:00:25""",
"router-2": None
}
 
int = ['nbon0','bond1']
 
#for k,v in x.itemm():
# print(k,v)
# if k == "router-1"
 
#def check_prefix_next_hops("router-1", "216.182.232.249/32", ["bond1", "bond3"])
def check_prefix_next_hops(router_name, given_prefix, expected_next_hop_interfaces):
#for k,v in r
router_output = MOCKED_DEVICE_DATA[router_name]
if given_prefix in router_output:
for i in range(len(expected_next_hop_interfaces)):
if expected_next_hop_interfaces[i] ==
</pre>
 
= Google =