码迷,mamicode.com
首页 > 其他好文 > 详细

tcpdump for container

时间:2021-06-10 17:55:40      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:with   started   cni   network   bec   global   bsp   http   www   

 

kubectl -n kube-system exec -it $pod -- ovs-vsctl list-ports br-int
ovnip=`ip a | grep "scope global ovn4nfv0" |awk {match($0, /.+inet\s([^ /]*)/, a);print a[3];exit}`
ifc=`ip a | grep "scope global ovn4nfv0" |awk {match($0, /.+global\s([^ /]*)/, a);print a[1];exit}`

# https://www.redhat.com/sysadmin/container-namespaces-nsenter
# https://www.thegeekdiary.com/how-to-access-docker-containers-network-namespace-from-host/
podn=sdewan-cnf  # cloud-gateway
pid=$(docker inspect -f {{.State.Pid}} $(docker ps -l -f name="$podn" -q))
mkdir -p /var/run/netns/
ln -sfT /proc/$pid/ns/net /var/run/netns/[$podn]
ip netns exec [$podn] ip a

# https://www.dasblinkenlichten.com/getting-started-with-calico-on-kubernetes/
# https://k8s.networkop.co.uk/cni/calico/

 

tcpdump for container

标签:with   started   cni   network   bec   global   bsp   http   www   

原文地址:https://www.cnblogs.com/shaohef/p/14868875.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!