ちょっと野暮用で、ローカルマシン内でポートフォワーディングを行おうとしているのだが、UDP と TCP の動作が微妙に違うようだ。
やりたい事は
any:UDP-HighPort → localhost:TCP-53 (→ localhost:TCP-1053)
というフォワードを行いたいわけだが、TDP だと戻りは
(localhost:TCP-1053 →) loaclhost:TCP-53 → any:TCP-HighPort
としてくれるが、UDP だと
localhost:TCP-1053 → any:TCP-HighPort
と元に戻してくれないらしい。(汗)
TCP
03000 fwd 192.168.1.10,1053 log tcp from 211.18.200.178 to 192.168.1.10 dst-port 53
03110 count log ip from 211.18.200.178 to me
03111 count log ip from me to 211.18.200.178
Apr 25 20:01:13 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 TCP 211.18.200.178:3865 192.168.1.10:53 in via fxp0
Apr 25 20:01:13 leviathan ipfw: 3111 Count TCP 192.168.1.10:53 211.18.200.178:3865 out via fxp0
Apr 25 20:01:13 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 TCP 211.18.200.178:3865 192.168.1.10:53 in via fxp0
Apr 25 20:01:13 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 TCP 211.18.200.178:3865 192.168.1.10:53 in via fxp0
Apr 25 20:01:13 leviathan ipfw: 3111 Count TCP 192.168.1.10:53 211.18.200.178:3865 out via fxp0
Apr 25 20:01:13 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 TCP 211.18.200.178:3865 192.168.1.10:53 in via fxp0
Apr 25 20:01:13 leviathan ipfw: 3111 Count TCP 192.168.1.10:53 211.18.200.178:3865 out via fxp0
Apr 25 20:01:13 leviathan ipfw: 3111 Count TCP 192.168.1.10:53 211.18.200.178:3865 out via fxp0
Apr 25 20:01:13 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 TCP 211.18.200.178:3865 192.168.1.10:53 in via fxp0
UDP
03000 fwd 192.168.1.10,1053 log udp from 211.18.200.178 to 192.168.1.10 dst-port 53
03110 count log ip from 211.18.200.178 to me
03111 count log ip from me to 211.18.200.178
Apr 25 20:08:29 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 UDP 211.18.200.178:2116 192.168.1.10:53 in via fxp0
Apr 25 20:08:29 leviathan ipfw: 3111 Count UDP 192.168.1.10:1053 211.18.200.178:2116 out via fxp0
Apr 25 20:08:29 leviathan ipfw: 3110 Count ICMP:3.3 211.18.200.178 192.168.1.10 in via fxp0
Apr 25 20:08:34 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 UDP 211.18.200.178:2116 192.168.1.10:53 in via fxp0
Apr 25 20:08:34 leviathan ipfw: 3111 Count UDP 192.168.1.10:1053 211.18.200.178:2116 out via fxp0
Apr 25 20:08:34 leviathan ipfw: 3110 Count ICMP:3.3 211.18.200.178 192.168.1.10 in via fxp0
Apr 25 20:08:44 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 UDP 211.18.200.178:2117 192.168.1.10:53 in via fxp0
Apr 25 20:08:44 leviathan ipfw: 3111 Count UDP 192.168.1.10:1053 211.18.200.178:2117 out via fxp0
Apr 25 20:08:44 leviathan ipfw: 3110 Count ICMP:3.3 211.18.200.178 192.168.1.10 in via fxp0
Apr 25 20:08:49 leviathan ipfw: 3000 Forward to 192.168.1.10:1053 UDP 211.18.200.178:2117 192.168.1.10:53 in via fxp0
Apr 25 20:08:49 leviathan ipfw: 3111 Count UDP 192.168.1.10:1053 211.18.200.178:2117 out via fxp0
Apr 25 20:08:49 leviathan ipfw: 3110 Count ICMP:3.3 211.18.200.178 192.168.1.10 in via fxp0
UDP ってこういう仕様だっけ?
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ 山銀
└ G兄