Hi,
I have following configuration: Router with 1.2.3.133/25 on ether1 (WAN) interface. /25 is not a mistake, ISP assigned 5 IPs in total within /25 network slice and control it by MAC:
1.2.3.250/25
1.2.3.251/25
1.2.3.252/25
1.2.3.253/25
Basically 1.2.3.133 has its default GW pointing to 1.2.3.129 (which is first usable address in this /25 slice). NAT for two bridges for two local networks in Bridge1 and Bridge2 is working fine as expected. Now I’d like to route one of the additional public IPs (253) to host in local network, made exceptions in filtering but I can’t make it working. Also I am not entirely sure if I should configure this host with .129 or .133 (my mikrotik router) as gateway. So far I’ve tried both but with no luck. I must be missing something.
/interface bridge
add admin-mac=64:D1:54:3D:DD:6F auto-mac=no comment=G name=bridge1
add comment=K name=bridge2
/interface wireguard
add comment=G listen-port=13231 mtu=1420 name=server-g
add comment=K listen-port=13232 mtu=1420 name=server-k
/interface list
add name=WAN
add name=LAN
/ip pool
add name=G ranges=192.168.100.50-192.168.100.254
add name=K ranges=192.168.101.50-192.168.101.254
/ip dhcp-server
add address-pool=G interface=bridge1 name=G
add address-pool=K interface=bridge2 name=K
/interface bridge port
add bridge=bridge1 comment=defconf disabled=yes interface=ether1
add bridge=bridge1 comment=defconf interface=ether2
add bridge=bridge1 comment=defconf interface=ether3
add bridge=bridge1 comment=defconf interface=ether4
add bridge=bridge2 comment=defconf interface=ether5
add bridge=bridge2 comment=defconf interface=ether6
add bridge=bridge2 comment=defconf interface=ether7
add bridge=bridge1 comment=defconf interface=ether8
add bridge=bridge1 comment=defconf interface=sfp9
add bridge=bridge1 comment=defconf interface=sfp10
add bridge=bridge1 comment=defconf interface=sfp11
add bridge=bridge1 comment=defconf interface=sfp12
/interface list member
add interface=ether1 list=WAN
add interface=bridge1 list=LAN
/interface wireguard peers
add allowed-address=172.16.101.2/32 comment=K interface=server-k \
public-key="xxx"
add allowed-address=172.16.101.3/32 client-address=172.16.101.3/32 comment=\
mobile interface=server-k public-key=\
"xxx"
/ip address
add address=192.168.100.1/24 comment=G interface=bridge1 network=\
192.168.100.0
add address=1.2.3.133/25 interface=ether1 network=1.2.3.128
add address=192.168.101.1/24 comment=K interface=bridge2 network=\
192.168.101.0
add address=172.16.101.1/24 comment=wg-server-k interface=server-k network=\
172.16.101.0
add address=172.16.100.1/24 comment=wg-server-g interface=\
server-g network=172.16.100.0
add address=1.2.3.253/25 comment=server interface=bridge2 \
network=1.2.3.128
/ip dhcp-client
add disabled=yes interface=ether1
/ip dhcp-server network
add address=192.168.100.0/24 dns-server=1.1.1.1 gateway=192.168.100.1 \
netmask=24
add address=192.168.101.0/24 dns-server=1.1.1.1 gateway=192.168.101.1 \
netmask=24
/ip dns
set servers=1.1.1.1,8.8.8.8
/ip firewall address-list
add address=192.168.100.0/24 comment=LAN-G list=trusted
add address=192.168.101.0/24 comment=LAN-K list=trusted
/ip firewall filter
add action=accept chain=input comment="allow wireguard server G" \
dst-port=13231 protocol=udp
add action=accept chain=input comment="allow wireguard server K" dst-port=\
13232 protocol=udp
add action=fasttrack-connection chain=forward comment=fasttrack \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment="accept established, related" \
connection-state=established,related
add action=drop chain=forward comment="drop invalid" connection-state=invalid
add action=drop chain=forward comment="drop invalid from WAN not DSTNATed" \
connection-nat-state=!dstnat connection-state=new in-interface=ether1
add action=accept chain=input comment="icmp reply" protocol=icmp
add action=accept chain=input comment="accept input, related" \
connection-state=established,related
add action=drop chain=input comment="default drop input" in-interface=ether1
/ip firewall nat
add action=masquerade chain=srcnat comment=NAT-G out-interface=ether1 \
src-address=192.168.100.0/24
add action=masquerade chain=srcnat comment=NAT-K out-interface=ether1 \
src-address=192.168.101.0/24
add action=masquerade chain=srcnat comment=wireguard-k out-interface=server-k
add action=masquerade chain=srcnat comment=wireguard-g out-interface=\
server-g
add action=masquerade chain=srcnat comment=wireguard-k-nat out-interface=\
ether1 src-address=172.16.101.0/24
add action=masquerade chain=srcnat comment=wireguard-g-nat \
out-interface=ether1 src-address=172.16.100.0/24
add action=dst-nat chain=dstnat comment=Nginx-G-443 dst-address=\
1.2.3.133 dst-port=443 protocol=tcp to-addresses=192.168.100.16 \
to-ports=443
add action=dst-nat chain=dstnat comment=Nginx-G-80 dst-address=\
1.2.3.133 dst-port=80 protocol=tcp to-addresses=192.168.100.16 \
to-ports=80
add action=masquerade chain=srcnat comment=Hairpin-NAT-G dst-address=\
192.168.100.0/24 out-interface=bridge1 protocol=tcp src-address=\
192.168.100.0/24 to-addresses=192.168.100.16
add action=masquerade chain=srcnat comment=Hairpin-NAT-K dst-address=\
192.168.101.0/24 out-interface=bridge2 protocol=tcp src-address=\
192.168.101.0/24
/ip service
set telnet disabled=yes
set ftp disabled=yes
/ip ssh
set host-key-size=4096 strong-crypto=yes
/system clock
set time-zone-name=Europe/Warsaw
/system identity
set name=crs112-8g-4s-in
/system note
set show-at-login=no
/system ntp client
set enabled=yes
/system ntp client servers
add address=0.pl.pool.ntp.org