I am having trouble getting source NAT to work on my router. I was able to setup destination NAT and it's working, so now I have traffic from the internet being translated into the private IP address I have setup on my server. However the reverse isn't working - traffic originating at the server isn't being translated from the private server IP to a public IP before being sent out to the internet. I've read through the docs and I think I have everything setup correctly, but there's obviously something missing here. Here's my config:
Code: Select all
# mar/10/2023 05:19:55 by RouterOS 7.8
# software id = RE0D-LFF9
#
# model = CCR2116-12G-4S+
# serial number = XXXXXXXXX67
/interface bridge
add name=loopback
/interface ethernet
set [ find default-name=sfp-sfpplus1 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full \
loop-protect=off speed=1Gbps
set [ find default-name=sfp-sfpplus2 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full speed=1Gbps
set [ find default-name=sfp-sfpplus3 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full speed=1Gbps
set [ find default-name=sfp-sfpplus4 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full speed=1Gbps
/interface ethernet switch
set 0 l3-hw-offloading=yes
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=XXXXXXXX
/port
set 0 name=serial0
/interface ethernet switch l3hw-settings
set ipv6-hw=yes
/interface detect-internet
set detect-interface-list=all
/ip address
add address=xxx.xxx.230.254/30 comment="xxx" interface=ether1 network=xxx.xxx.230.252
add address=206.80.238.152/24 comment="xxx" interface=sfp-sfpplus1 network=xxx.xxx.238.0
add address=xxx.xxx.131.121/30 comment="xxx" interface=ether9 network=xxx.xxx.131.120
add address=xxx.xxx.131.125/30 comment="xxx" interface=ether12 network=xxx.xxx.131.124
add address=xxx.xxx.131.101/30 comment="xxx" interface=ether11 network=xxx.xxx.131.100
add address=xxx.xxx.131.97/30 comment="xxx" interface=ether2 network=xxx.xxx.131.96
add address=xxx.xxx.131.105/30 comment="xxx" interface=ether10 network=xxx.xxx.131.104
add address=xxx.xxx.131.109/30 comment="xxx.com IP" interface=ether11 network=xxx.xxx.131.108
add address=xxx.xxx.131.113/30 comment="xxx.com IP" interface=ether11 network=xxx.xxx.131.112
add address=192.168.10.1/24 comment="xxx" interface=ether10 network=192.168.10.0
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip firewall nat
add action=masquerade chain=srcnat comment="TRAFFIC OUT FROM SERVER" src-address=xxx.xxx.131.106
add action=src-nat chain=srcnat src-address=192.168.10.10 to-addresses=xxx.xxx.131.106
add action=masquerade chain=srcnat comment="TRAFFIC INTO SERVER" dst-address=192.168.10.10
add action=dst-nat chain=dstnat dst-address=xxx.xxx.131.106 to-addresses=192.168.10.10
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=xxx.xxx.230.253 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=xxx.xxx.238.152/32 gateway=xxx.xxx.230.253 pref-src="" \
routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=xxx.xxx.131.107/32 gateway=ether12 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=xxx.xxx.131.98/32 gateway=ether3 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=xxx.xxx.131.97/32 gateway=ether2 pref-src="" routing-table=main scope=30 \
suppress-hw-offload=no target-scope=10
add disabled=no dst-address=xxx.xxx.131.96/27 gateway=xxx.xxx.131.97 routing-table=main suppress-hw-offload=no
/ipv6 route
add blackhole disabled=no dst-address=xxxx:xxxx:a000::/48 gateway="" routing-table=main
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/ip ssh
set strong-crypto=yes
/ipv6 address
add address=xxxx:xxxx:1:ecc::2/126 advertise=no interface=ether1
add address=xxxx:xxxx:a000::1/128 advertise=no interface=loopback
add address=xxxx:xxxx:91::152 advertise=no interface=sfp-sfpplus1
/ipv6 firewall address-list
add address=xxxx:xxxx:a000::/48 list=ASXXX931-V6
/ipv6 firewall filter
add action=accept chain=input dst-port=179 log=yes protocol=tcp
/routing bgp connection
add address-families=ip as=xxx931 connect=yes disabled=no input.filter="" listen=yes local.role=ebgp name=\
XX_TRANSIT_IPv4 output.filter-chain=ASxxx931-V6 remote.address=xxx.xxx.230.253/32 .as=xx39 routing-table=main
add address-families=ipv6 as=xxx931 connect=yes disabled=no listen=yes local.address=xxxx:xxxx:1:ecc::2 .role=ebgp name=\
XX_TRANSIT_IPv6 output.default-originate=never .filter-chain=ASxxx931-V6 .redistribute=connected,static,ospf,bgp \
remote.address=xxxx:xxxx:1:ecc::1/128 .as=xx39 routing-table=main
add address-families=ipv6 as=xxx931 connect=yes disabled=no listen=yes local.address=xxxx:xxxx:91::152 .role=ebgp-rs \
name=XXXX_RS1_IPv6 remote.address=xxxx:xxxx:91::253/128 .as=7034 routing-table=main
add address-families=ip as=xxx931 connect=yes disabled=no input.filter="" listen=yes local.address=xxx.xxx.238.152 .port=\
0 .role=ebgp-rs name=XXXX_RS1_IPv4 output.redistribute=connected,static,bgp remote.address=xxx.xxx.238.253/32 \
.allowed-as="" .as=xx34 routing-table=main
add address-families=ip as=xxx931 as-override=no connect=yes disabled=no listen=yes local.address=xxx.xxx.238.152 .port=0 \
.role=ebgp-rs name=XXXX_RS2_IPv4 remote.address=xxx.xxx.238.254/32 .as=XX34 routing-table=main
add address-families=ipv6 as=XXX931 connect=yes disabled=no listen=yes local.address=xxxx:xxxx:91::152 .role=ebgp-rs \
name=XXXX_RS2_IPv6 remote.address=xxxx:xxxx:91::254/128 .as=XX34 routing-table=main
/routing filter rule
add chain=ASxxx931-V6 disabled=no rule="if(dst in ASXXX931-V6){accept;}"
/system clock
set time-zone-name=America/Los_Angeles
/system clock manual
set dst-delta=+01:00 dst-end="nov/05/2023 02:00:00" dst-start="mar/12/2023 02:00:00"
/system logging
add topics=debug
add action=echo topics=firewall
/tool graphing interface
add
/tool traffic-monitor
add interface=ether1 name=tmon1