1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure net上で問題なければ、VM OS レベルで確認しましょう(Linux系)

Last updated at Posted at 2025-08-13

背景

AppGW(VnetA) →→AzFW(hubVnet)→→VM (VnetB)の構成で、VMはAppGWのBackend poolですが、突然AppGWからの正常性はunreachableとなっています。なんかAppGWからVMへの通信は届かないようです。
それについて調査いたしました。

調査経緯

1.まず一通り、VnetA上のNSG,UDRを確認します。Vnet BのNSG,UDRを確認します。全部異常なしです。
昨日まで無事に到達できたので、こちら変は変更ないので、問題ないです。

2.AzWFのログを確認して、ちゃんとAppGWからのprobe通信がAzFW通過した履歴が確認できました。

3.VM側のaccess ログを確認したら、該当probe通信のログはありません。

4.他のVMから該当VMへcurlを実施して特にhttp 80で無事に200が返ってきますので、VMのapplication は正常に動いています。

image.png

4.では、VM上でtcpdumpログを採取します。AppGWは常にprobe 通信を出していますので、5分間を採取します。
sudo tcpdump -s0 -i any -n -w outfile.pcap

5.採取したログを分析してみると以下の可笑しい箇所があります。
1.AppGW instance IPからのSYNがあります、VMからのSYN ACKはありませんでした。
そして、VM からVM自身へのICMPがあり、[Unreachable]との情報があります。
image.png
Icmpのメッセージ詳細をみると、「10.25.4.4」から[172.18.25.6]へのSYN ACKの内容でした。
おそらくOS上でSYN ACKがうまく出せなかったようにみえます。
正常の場合は、VMからSYN ACKを返すログが見れるはず。
image.png

6.ではやはりVM内部のroute情報を確認すべきです。
以下のiptablesからなんとなる読み取れる:
172.18.25.6からの通信は、Dockerの隔離ルール(br-ab60325e9045関連のDROP)やFORWARDポリシーのDROPによりブロックされています。これが原因でtcpdump log上にはSYN ACKすら見えない不思議が現象が出ました。

IP route
default via 10.25.4.1 dev eth0 proto dhcp src 10.25.4.4 metric 100 
10.25.4.0/28 dev eth0 proto kernel scope link src 10.25.4.4 metric 100 
10.25.4.1 dev eth0 proto dhcp scope link src 10.25.4.4 metric 100 
168.63.129.16 via 10.25.4.1 dev eth0 proto dhcp src 10.25.4.4 metric 100 
169.254.169.254 via 10.25.4.1 dev eth0 proto dhcp src 10.25.4.4 metric 100 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 
172.18.0.0/16 dev br-ab60325e9045 proto kernel scope link src 172.18.0.1 

sudo iptables -L -v -n --line-numbers

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1     2136  613K DOCKER-USER  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
2     2136  613K DOCKER-FORWARD  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         

Chain DOCKER (2 references)
num   pkts bytes target     prot opt in     out     source               destination         
1        0     0 ACCEPT     tcp  --  !br-ab60325e9045 br-ab60325e9045  0.0.0.0/0            172.18.0.3           tcp dpt:3000
2        0     0 ACCEPT     tcp  --  !br-ab60325e9045 br-ab60325e9045  0.0.0.0/0            172.18.0.6           tcp dpt:9001
3        0     0 ACCEPT     tcp  --  !br-ab60325e9045 br-ab60325e9045  0.0.0.0/0            172.18.0.6           tcp dpt:9000
4        0     0 ACCEPT     tcp  --  !docker0 docker0  0.0.0.0/0            172.17.0.6           tcp dpt:3000
5        0     0 ACCEPT     tcp  --  !docker0 docker0  0.0.0.0/0            172.17.0.5           tcp dpt:7000

Chain DOCKER-BRIDGE (1 references)
num   pkts bytes target     prot opt in     out     source               destination         
1        0     0 DOCKER     all  --  *      br-ab60325e9045  0.0.0.0/0            0.0.0.0/0           
2        0     0 DOCKER     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0           

Chain DOCKER-CT (1 references)
num   pkts bytes target     prot opt in     out     source               destination         
1      678  396K ACCEPT     all  --  *      br-ab60325e9045  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
2      356 64557 ACCEPT     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED

Chain DOCKER-FORWARD (1 references)
num   pkts bytes target     prot opt in     out     source               destination         
1     2136  613K DOCKER-CT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
2     1102  152K DOCKER-ISOLATION-STAGE-1  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
3     1102  152K DOCKER-BRIDGE  all  --  *      *       0.0.0.0/0            0.0.0.0/0  

Dockerのbridge network interfaceがVMのNicに影響したとみられます。通信はcontainer -> docker bridge -> NIC の docker bridge で落としていたら NIC でパケットキャプチャしても syn+ack が取れないです。なるほどね。

結論

Azure Vnet上に異常なければ、tcpdumpを採取して、VMのroute とIP tableを確認しましょう。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?