File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -419,22 +419,36 @@ trace(){
419
419
420
420
case $type in
421
421
icmp)
422
+ icmp_type=" "
423
+ if [ $af -eq 6 ]; then
424
+ # echo request
425
+ icmp_type=" 6.type == 128"
426
+ fi
422
427
set -x
423
- kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " " inport == \" $lsp \" && ip.ttl == 64 && icmp && eth.src == $mac && ip$af .src == $srcIP && eth.dst == $dstMac && ip$af .dst == $dst && ct.new"
428
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace --ct=new --ct=new --ct=new --ct=new " $ls " \
429
+ " inport == \" $lsp \" && ip.ttl == 255 && icmp$icmp_type && eth.src == $mac && ip$af .src == $srcIP && eth.dst == $dstMac && ip$af .dst == $dst "
424
430
;;
425
431
tcp|udp)
432
+ tcp_flags=" "
433
+ if [ " $type " = " tcp" ]; then
434
+ # TCP SYN
435
+ tcp_flags=" && tcp.flags == 2"
436
+ fi
426
437
set -x
427
- kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " " inport == \" $lsp \" && ip.ttl == 64 && eth.src == $mac && ip$af .src == $srcIP && eth.dst == $dstMac && ip$af .dst == $dst && $type .src == 10000 && $type .dst == $4 && ct.new"
438
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace --ct=new --ct=new --ct=new --ct=new " $ls " \
439
+ " inport == \" $lsp \" && ip.ttl == 255 && eth.src == $mac && ip$af .src == $srcIP && eth.dst == $dstMac && ip$af .dst == $dst && $type .src == 30000 && $type .dst == $4 $tcp_flags "
428
440
;;
429
441
arp)
430
442
case " $4 " in
431
443
" " |request)
432
444
set -x
433
- kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " " inport == \" $lsp \" && eth.src == $mac && eth.dst == $dstMac && arp.op == 1 && arp.sha == $mac && arp.tha == 00:00:00:00:00:00 && arp.spa == $srcIP && arp.tpa == $dst "
445
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " \
446
+ " inport == \" $lsp \" && eth.src == $mac && eth.dst == $dstMac && arp.op == 1 && arp.sha == $mac && arp.tha == 00:00:00:00:00:00 && arp.spa == $srcIP && arp.tpa == $dst "
434
447
;;
435
448
reply)
436
449
set -x
437
- kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " " inport == \" $lsp \" && eth.src == $mac && eth.dst == $dstMac && arp.op == 2 && arp.sha == $mac && arp.tha == $dstMac && arp.spa == $srcIP && arp.tpa == $dst "
450
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " \
451
+ " inport == \" $lsp \" && eth.src == $mac && eth.dst == $dstMac && arp.op == 2 && arp.sha == $mac && arp.tha == $dstMac && arp.spa == $srcIP && arp.tpa == $dst "
438
452
;;
439
453
* )
440
454
echo " Error: invalid ARP type $4 "
You can’t perform that action at this time.
0 commit comments