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 @@ -409,22 +409,36 @@ trace(){
409
409
410
410
case $type in
411
411
icmp)
412
+ icmp_type=" "
413
+ if [ $af -eq 6 ]; then
414
+ # echo request
415
+ icmp_type=" 6.type == 128"
416
+ fi
412
417
set -x
413
- 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"
418
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace --ct=new --ct=new --ct=new --ct=new " $ls " \
419
+ " inport == \" $lsp \" && ip.ttl == 255 && icmp$icmp_type && eth.src == $mac && ip$af .src == $srcIP && eth.dst == $dstMac && ip$af .dst == $dst "
414
420
;;
415
421
tcp|udp)
422
+ tcp_flags=" "
423
+ if [ " $type " = " tcp" ]; then
424
+ # TCP SYN
425
+ tcp_flags=" && tcp.flags == 2"
426
+ fi
416
427
set -x
417
- 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"
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 && eth.src == $mac && ip$af .src == $srcIP && eth.dst == $dstMac && ip$af .dst == $dst && $type .src == 30000 && $type .dst == $4 $tcp_flags "
418
430
;;
419
431
arp)
420
432
case " $4 " in
421
433
" " |request)
422
434
set -x
423
- 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 "
435
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " \
436
+ " 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 "
424
437
;;
425
438
reply)
426
439
set -x
427
- 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 "
440
+ kubectl exec " $OVN_SB_POD " -n $KUBE_OVN_NS -c ovn-central -- ovn-trace " $ls " \
441
+ " inport == \" $lsp \" && eth.src == $mac && eth.dst == $dstMac && arp.op == 2 && arp.sha == $mac && arp.tha == $dstMac && arp.spa == $srcIP && arp.tpa == $dst "
428
442
;;
429
443
* )
430
444
echo " Error: invalid ARP type $4 "
You can’t perform that action at this time.
0 commit comments