Unfortunately it doesn’t work, it still output on WAN2 the LAN address as source, and the packet die in the next hop. It’s like it doesn’t complete the dstnat procedure, if it does, then it should have the WAN2 source IP. I don’t know why mangle mark routing, and it routes before the packet can be changed by dstnat, the packet exit form WAN2 as it comes from LAN, how can I postpone the routing after the competion of dstnat?
this is the config:
# 2023-11-10 18:31:13 by RouterOS 7.10.1
# software id = U31Z-TEGH
#
# model = RB750r2
# serial number = 8B3808E10A62
/interface bridge
add admin-mac=CC:2D:E0:69:19:FA auto-mac=no comment=defconf name=bridge
add name=bridgeOVPN
/interface ethernet
set [ find default-name=ether1 ] l2mtu=1600
set [ find default-name=ether2 ] l2mtu=1600
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-client option
add code=55 name=parameter_request_list value=0x010306212A79F9
/ip dhcp-server option
add code=6 name="DNS Alternative" value="'64.225.68.86'"
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add name=default-dhcp ranges=192.168.101.100-192.168.101.200
/ip dhcp-server
add address-pool=default-dhcp interface=bridge lease-time=1w name=defconf
/ppp profile
add bridge=bridgeOVPN local-address=192.168.2.3 name=OVPN2 remote-address=\
192.168.2.1 use-ipv6=no use-mpls=no
/interface ovpn-client
add cipher=aes256-cbc connect-to=146.66.181.172 mac-address=02:A3:5E:EB:58:64 \
max-mtu=1460 name=Vdv port=44301 profile=OVPN2 use-peer-dns=no user=OVPN2
/interface l2tp-client
add add-default-route=yes connect-to=tp.internet.beeline.ru \
default-route-distance=2 disabled=no max-mtu=1460 name=l2tp-beeline \
profile=default use-peer-dns=exclusively user=0892090319
/queue simple
add name=queue4 priority=5/5 target=192.168.101.100/32
add name=queue5 priority=5/5 target=192.168.101.101/32
add disabled=yes max-limit=20M/20M name=queue1 target=192.168.0.112/32
add disabled=yes max-limit=5M/5M name=queue2 target=192.168.0.104/32
add limit-at=50M/50M max-limit=70M/70M name=queue3 target=192.168.101.116/32
/routing table
add disabled=no fib name=vdv
/snmp community
set [ find default=yes ] addresses=192.168.0.0/24 write-access=yes
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ipv6 settings
set disable-ipv6=yes
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf disabled=yes interface=ether1 list=WAN
add interface=l2tp-beeline list=WAN
add interface=ether2 list=LAN
add interface=bridgeOVPN list=LAN
add interface=Vdv list=WAN
/ip address
add address=192.168.0.10/24 comment=defconf interface=bridge network=\
192.168.0.0
add address=192.168.99.1/24 comment=defconf disabled=yes interface=bridge \
network=192.168.99.0
add address=192.168.101.10/24 comment=defconf interface=bridge network=\
192.168.101.0
/ip dhcp-client
add comment=defconf default-route-distance=5 dhcp-options=\
parameter_request_list,hostname interface=ether1
/ip dhcp-server lease
add address=192.168.101.100 mac-address=10:F0:05:CA:8A:0A server=defconf
add address=192.168.99.101 disabled=yes mac-address=D8:CE:3A:FC:C8:7D server=\
defconf
add address=192.168.101.252 mac-address=98:CD:AC:30:AF:9F server=defconf
add address=192.168.101.253 client-id=1:12:42:7d:5c:19:78 mac-address=\
12:42:7D:5C:19:78 server=defconf
add address=192.168.101.101 client-id=1:d8:ce:3a:fc:c8:7d mac-address=\
D8:CE:3A:FC:C8:7D server=defconf
add address=192.168.101.116 client-id=1:b4:2e:99:e5:95:6d mac-address=\
B4:2E:99:E5:95:6D server=defconf
add address=192.168.101.250 client-id=1:80:f3:ef:8e:32:3 mac-address=\
80:F3:EF:8E:32:03 server=defconf
/ip dhcp-server network
add address=192.168.101.0/24 comment=defconf dns-server=\
8.8.8.8,1.1.1.1,192.168.101.10 gateway=192.168.101.10 netmask=24
/ip dns
set allow-remote-requests=yes servers=208.67.222.222,64.225.68.86
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
add address=192.168.0.100 name=vdv.vdv
/ip firewall address-list
add address=192.168.0.100 list=test
add address=192.168.0.101 list=test
/ip firewall filter
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" disabled=yes \
dst-address=127.0.0.1
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=drop chain=forward disabled=yes dst-address=192.168.2.0/24 \
in-interface=bridge src-address-list=!test
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
connection-state=new in-interface-list=!LAN
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,new,untracked disabled=yes in-interface=bridgeOVPN
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
/ip firewall mangle
add action=mark-routing chain=prerouting disabled=yes dst-address=\
!192.168.0.0/16 new-routing-mark=vdv passthrough=no protocol=!udp \
src-address=192.168.0.250
add action=mark-routing chain=prerouting disabled=yes dst-address=\
!192.168.0.0/16 new-routing-mark=vdv passthrough=no protocol=!udp \
src-address=192.168.101.100
add action=mark-routing chain=prerouting disabled=yes dst-address=\
!192.168.0.0/16 new-routing-mark=vdv passthrough=no protocol=!udp \
src-address=192.168.101.101
add action=mark-routing chain=prerouting disabled=yes dst-address=\
!192.168.0.0/16 new-routing-mark=vdv passthrough=no protocol=!udp \
src-address=192.168.101.106
add action=mark-routing chain=prerouting connection-nat-state=dstnat \
dst-address=192.168.2.3 dst-port=8001 new-routing-mark=vdv passthrough=\
yes protocol=tcp
/ip firewall nat
add action=src-nat chain=srcnat out-interface=Vdv routing-mark=vdv \
to-addresses=192.168.2.3
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=src-nat chain=srcnat dst-address=192.168.2.2 to-addresses=\
192.168.2.3
add action=src-nat chain=srcnat dst-address=192.168.2.4 to-addresses=\
192.168.2.3
add action=src-nat chain=srcnat dst-port=8291 protocol=tcp src-address=\
192.168.0.100 to-addresses=192.168.2.3
add action=redirect chain=dstnat dst-address=192.168.0.100 dst-port=80 \
protocol=tcp src-address=192.168.0.0/24 to-ports=1880
add action=src-nat chain=srcnat out-interface=Vdv routing-mark=vdv \
src-address=192.168.101.100 to-addresses=192.168.2.3
add action=dst-nat chain=dstnat dst-address=192.168.2.3 dst-port=8001 \
protocol=tcp to-addresses=192.168.101.100 to-ports=8001
/ip route
add disabled=yes distance=1 dst-address=192.168.88.0/24 gateway=192.168.0.111 \
pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=192.168.1.0/24 gateway=192.168.2.1 \
routing-table=main scope=10 suppress-hw-offload=no
add disabled=no distance=8 dst-address=0.0.0.0/0 gateway=192.168.2.1 \
pref-src=192.168.2.3 routing-table=vdv scope=30 suppress-hw-offload=no \
target-scope=10
add disabled=no dst-address=192.168.3.0/24 gateway=192.168.2.2 routing-table=\
main suppress-hw-offload=no
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
add action=accept chain=forward comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
/ppp secret
add name=OVPN2 profile=OVPN2 service=ovpn
/snmp
set enabled=yes
/system clock
set time-zone-name=Europe/Moscow
/system identity
set name=Baklazhan
/system note
set show-at-login=no
/system ntp client
set enabled=yes
/system ntp client servers
add address=193.204.114.232
add address=132.163.97.5
/system scheduler
add interval=1m name="Renew gateway" on-event="/ip dhcp-client renew ether1" \
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=1970-01-01 start-time=00:00:01
add interval=1d name="Public IP renew" on-event=\
"/interface l2tp-client disable 0\r\
\n/interface l2tp-client enable 0\r\
\n" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=2023-03-25 start-time=06:30:00
/system script
add dont-require-permissions=no name="Public IP renew" owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
"/interface l2tp-client disable 0\r\
\n/interface l2tp-client enable 0\r\
\n"
/system watchdog
set auto-send-supout=yes ping-start-after-boot=10m send-email-to=\
aa@bb.cc watch-address=8.8.8.8
/tool e-mail
set address=mail.sicurezza.ru from=aa@bb.cc port=2525 user=\
service@sicurezza.ru
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool sniffer
set filter-interface=bridge filter-mac-protocol=arp