История изменений
Исправление intelfx, (текущая версия) :
Так у меня и не пятое, а 4.14.
А что и как конкретно ты проверял?
Для протокола попробовал с -I
, ничего не изменилось (и не должно было):
# iptables -t nat -F OUTPUT
# iptables -t nat -I OUTPUT -d 1.2.3.4 -p tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
# iptables -t nat -S OUTPUT
-P OUTPUT ACCEPT
-A OUTPUT -d 1.2.3.4/32 -p tcp -m tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
root@router:~# curl https://domain.tld:4433
^C
Параллельно:
# tcpdump -vvv -i wan0 'dst port 4433'
tcpdump: listening on wan0, link-type EN10MB (Ethernet), capture size 262144 bytes
04:49:05.285304 IP (tos 0x0, ttl 64, id 65247, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xafe7), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569780611 ecr 0,nop,wscale 5], length 0
04:49:06.328403 IP (tos 0x0, ttl 64, id 65248, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xabd4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569781654 ecr 0,nop,wscale 5], length 0
04:49:08.408302 IP (tos 0x0, ttl 64, id 65249, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xa3b4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569783734 ecr 0,nop,wscale 5], length 0
04:49:12.488294 IP (tos 0x0, ttl 64, id 65250, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0x93c4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569787814 ecr 0,nop,wscale 5], length 0
^C
4 packets captured
208 packets received by filter
137 packets dropped by kernel
# tcpdump -vvv -i lan0 'dst port 4433'
tcpdump: listening on lan0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
17 packets received by filter
0 packets dropped by kernel
Как бы корень проблемы понятен (vel выше привёл код — reroute check происходит до nat/OUTPUT). Непонятно только, что с этим можно сделать без банальных хаков с поддельными таблицами маршрутизации или поддельным DNS.
Исправление intelfx, :
Так у меня и не пятое, а 4.14.
А что и как конкретно ты проверял?
Для протокола попробовал с -I
, ничего не изменилось (и не должно было):
# iptables -t nat -F OUTPUT
# iptables -t nat -I OUTPUT -d 1.2.3.4 -p tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
# iptables -t nat -S OUTPUT
-P OUTPUT ACCEPT
-A OUTPUT -d 1.2.3.4/32 -p tcp -m tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
root@router:~# curl https://domain.tld:4433
^C
Параллельно:
# tcpdump -vvv -i wan0 'dst port 4433'
tcpdump: listening on wan0, link-type EN10MB (Ethernet), capture size 262144 bytes
04:49:05.285304 IP (tos 0x0, ttl 64, id 65247, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xafe7), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569780611 ecr 0,nop,wscale 5], length 0
04:49:06.328403 IP (tos 0x0, ttl 64, id 65248, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xabd4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569781654 ecr 0,nop,wscale 5], length 0
04:49:08.408302 IP (tos 0x0, ttl 64, id 65249, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xa3b4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569783734 ecr 0,nop,wscale 5], length 0
04:49:12.488294 IP (tos 0x0, ttl 64, id 65250, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0x93c4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569787814 ecr 0,nop,wscale 5], length 0
^C
4 packets captured
208 packets received by filter
137 packets dropped by kernel
# tcpdump -vvv -i lan0 'dst port 4433'
tcpdump: listening on lan0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
17 packets received by filter
0 packets dropped by kernel
Как бы корень проблемы понятен (vel выше привёл код — reroute check происходит до nat/OUTPUT); непонятно, что с ней можно сделать без банальных хаков с поддельными таблицами маршрутизации.
Исправление intelfx, :
Так у меня и не пятое, а 4.14.
А что и как конкретно ты проверял?
Для протокола попробовал с -I
, ничего не изменилось (и не должно было):
# iptables -t nat -F OUTPUT
# iptables -t nat -I OUTPUT -d 1.2.3.4 -p tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
# iptables -t nat -S OUTPUT
-P OUTPUT ACCEPT
-A OUTPUT -d 1.2.3.4/32 -p tcp -m tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
root@router:~# curl https://domain.tld:4433
^C
Параллельно:
root@router:~# tcpdump -vvv -i wan0 'dst port 4433'
tcpdump: listening on wan0, link-type EN10MB (Ethernet), capture size 262144 bytes
04:49:05.285304 IP (tos 0x0, ttl 64, id 65247, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xafe7), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569780611 ecr 0,nop,wscale 5], length 0
04:49:06.328403 IP (tos 0x0, ttl 64, id 65248, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xabd4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569781654 ecr 0,nop,wscale 5], length 0
04:49:08.408302 IP (tos 0x0, ttl 64, id 65249, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xa3b4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569783734 ecr 0,nop,wscale 5], length 0
04:49:12.488294 IP (tos 0x0, ttl 64, id 65250, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0x93c4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569787814 ecr 0,nop,wscale 5], length 0
^C
4 packets captured
208 packets received by filter
137 packets dropped by kernel
root@router:~# tcpdump -vvv -i lan0 'dst port 4433'
tcpdump: listening on lan0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
17 packets received by filter
0 packets dropped by kernel
Как бы корень проблемы понятен (vel выше привёл код — reroute check происходит до nat/OUTPUT); непонятно, что с ней можно сделать без банальных хаков с поддельными таблицами маршрутизации.
Исправление intelfx, :
Так у меня и не пятое, а 4.14.
А что и как конкретно ты проверял?
Для протокола попробовал с -I
, ничего не изменилось (и не должно было):
# iptables -t nat -F OUTPUT
# iptables -t nat -I OUTPUT -d 1.2.3.4 -p tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
# iptables -t nat -S OUTPUT
-P OUTPUT ACCEPT
-A OUTPUT -d 1.2.3.4/32 -p tcp -m tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
root@router:~# curl https://domain.tld:4433
^C
Параллельно:
root@router:~# tcpdump -vvv -i wan0 'dst port 4433'
tcpdump: listening on wan0, link-type EN10MB (Ethernet), capture size 262144 bytes
04:49:05.285304 IP (tos 0x0, ttl 64, id 65247, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xafe7), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569780611 ecr 0,nop,wscale 5], length 0
04:49:06.328403 IP (tos 0x0, ttl 64, id 65248, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xabd4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569781654 ecr 0,nop,wscale 5], length 0
04:49:08.408302 IP (tos 0x0, ttl 64, id 65249, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xa3b4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569783734 ecr 0,nop,wscale 5], length 0
04:49:12.488294 IP (tos 0x0, ttl 64, id 65250, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0x93c4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569787814 ecr 0,nop,wscale 5], length 0
^C
4 packets captured
208 packets received by filter
137 packets dropped by kernel
root@router:~# tcpdump -vvv -i lan0 'dst port 4433'
tcpdump: listening on lan0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
17 packets received by filter
0 packets dropped by kernel
Исходная версия intelfx, :
Так у меня и не пятое, а 4.14.
А что и как конкретно ты проверял?
Для протокола попробовал с -I
, ничего не изменилось:
# iptables -t nat -F OUTPUT
# iptables -t nat -I OUTPUT -d 1.2.3.4 -p tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
# iptables -t nat -S OUTPUT
-P OUTPUT ACCEPT
-A OUTPUT -d 1.2.3.4/32 -p tcp -m tcp --dport 4433 -j DNAT --to-destination 10.0.0.2
root@router:~# curl https://domain.tld:4433
^C
Параллельно:
root@router:~# tcpdump -vvv -i wan0 'dst port 4433'
tcpdump: listening on wan0, link-type EN10MB (Ethernet), capture size 262144 bytes
04:49:05.285304 IP (tos 0x0, ttl 64, id 65247, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xafe7), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569780611 ecr 0,nop,wscale 5], length 0
04:49:06.328403 IP (tos 0x0, ttl 64, id 65248, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xabd4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569781654 ecr 0,nop,wscale 5], length 0
04:49:08.408302 IP (tos 0x0, ttl 64, id 65249, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0xa3b4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569783734 ecr 0,nop,wscale 5], length 0
04:49:12.488294 IP (tos 0x0, ttl 64, id 65250, offset 0, flags [DF], proto TCP (6), length 60)
1.2.3.4.37946 > 10.0.0.2.4433: Flags [S], cksum 0x0c75 (incorrect -> 0x93c4), seq 2404737296, win 43690, options [mss 65495,sackOK,TS val 1569787814 ecr 0,nop,wscale 5], length 0
^C
4 packets captured
208 packets received by filter
137 packets dropped by kernel
root@router:~# tcpdump -vvv -i lan0 'dst port 4433'
tcpdump: listening on lan0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
17 packets received by filter
0 packets dropped by kernel