環境設定
BCCのリポジトリをGitクローンする
cd /usr/local/src
git clone git clone https://github.com/iovisor/bcc.git
tracing
tcpv4connect.py
プログラムを起動する
python3 /usr/local/src/eBPF/bcc/examples/tracing/tcpv4connect.py
別画面からcurl https://google.com
を実行する
PID COMM SADDR DADDR DPORT
1843 curl 172.31.xx.xx 172.253.xx.xx 443
別画面からcurl http://localhost
を実行する
PID COMM SADDR DADDR DPORT
1847 curl 127.0.0.1 127.0.0.1 80
Networking
http_filter
python3 /usr/local/src/eBPF/bcc/examples/networking/http_filter/http-parse-simple.py
別画面からcurl http://google.com
を実行する
GET / HTTP/1.1
HTTP/1.1 301 Moved Permanently