Hi,
I’ve been ask to find a way to allow several devices with same static IP address/subnetmask/gateway to access.
Eg.
eth2- device1-192.168.2.254/24
eth3- device2-192.168.2.254/24
eth4- device3-192.168.2.254/24
…
eth10- device10-192.168.2.254/24
eth1- Control PC-192.168.11.x/24
We’re using WAN(eth1) access through ICMP and SSH to eth2-10(which all the same ip as 192.168.2.254)
eth1-WAN interface, SRC-NAT/Masquerade.
I did followed the link as below for some inspiration
http://forum.mikrotik.com/t/how-to-allow-two-devices-with-same-ip-access-internet/115990/1
As for now connect is good, but we faced a little bug, which is that as we connect device 2 & 3, and both ping is OK.
But as we ping the rest of the port with no connection is still reachable.
Is there any idea about how to clear identify each port?
/interface list member
add comment=defconf interface=ether1 list=WAN
add comment=--L interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add interface=ether6 list=LAN
add interface=ether7 list=LAN
add interface=ether8 list=LAN
add interface=ether9 list=LAN
add interface=ether10 list=LAN
add interface=bridge list=WAN
/ip address
add address=192.168.11.2/24 interface=ether1 network=192.168.11.0
add address=192.168.11.3/24 interface=ether1 network=192.168.11.0
add address=192.168.11.4/24 interface=ether1 network=192.168.11.0
add address=192.168.11.5/24 interface=ether1 network=192.168.11.0
add address=192.168.11.6/24 interface=ether1 network=192.168.11.0
add address=192.168.11.7/24 interface=ether1 network=192.168.11.0
add address=192.168.11.8/24 interface=ether1 network=192.168.11.0
add address=192.168.11.9/24 interface=ether1 network=192.168.11.0
add address=192.168.11.10/24 interface=ether1 network=192.168.11.0
add address=192.168.2.99/24 interface=ether2 network=192.168.2.0
add address=192.168.2.99/24 interface=ether3 network=192.168.2.0
add address=192.168.2.99/24 interface=ether4 network=192.168.2.0
add address=192.168.2.99/24 interface=ether5 network=192.168.2.0
add address=192.168.2.99/24 interface=ether6 network=192.168.2.0
add address=192.168.2.99/24 interface=ether7 network=192.168.2.0
add address=192.168.2.99/24 interface=ether8 network=192.168.2.0
add address=192.168.2.99/24 interface=ether9 network=192.168.2.0
add address=192.168.2.99/24 interface=ether10 network=192.168.2.0
/ip dhcp-client
add comment=defconf disabled=no interface=ether1
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip 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 ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
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=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
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 all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall mangle
add action=mark-connection chain=prerouting dst-address=192.168.11.2 \
new-connection-mark=port1 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.3 \
new-connection-mark=port2 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.4 \
new-connection-mark=port3 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.5 \
new-connection-mark=port4 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.6 \
new-connection-mark=port5 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.7 \
new-connection-mark=port6 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.8 \
new-connection-mark=port7 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.9 \
new-connection-mark=port8 passthrough=yes
add action=mark-connection chain=prerouting dst-address=192.168.11.10 \
new-connection-mark=port9 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether2 \
new-connection-mark=port1 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether3 \
new-connection-mark=port2 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether4 \
new-connection-mark=port3 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether5 \
new-connection-mark=port4 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether6 \
new-connection-mark=port5 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether7 \
new-connection-mark=port6 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether8 \
new-connection-mark=port7 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether9 \
new-connection-mark=port8 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether10 \
new-connection-mark=port9 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=port1 \
new-routing-mark=port1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port2 \
new-routing-mark=port2 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port3 \
new-routing-mark=port3 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port4 \
new-routing-mark=port4 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port5 \
new-routing-mark=port5 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port6 \
new-routing-mark=port6 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port9 \
new-routing-mark=port9 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port7 \
new-routing-mark=port7 passthrough=no
add action=mark-routing chain=prerouting connection-mark=port8 \
new-routing-mark=port8 passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat connection-limit=100,32 connection-type="" \
dst-address=192.168.11.2 dst-limit=1,5,dst-address/1m40s routing-mark=\
port1 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.3 dst-limit=\
1,5,dst-address/1m40s routing-mark=port2 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.4 dst-limit=\
1,5,dst-address/1m40s routing-mark=port3 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.5 dst-limit=\
1,5,dst-address/1m40s routing-mark=port4 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.6 dst-limit=\
1,5,dst-address/1m40s routing-mark=port5 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.7 dst-limit=\
1,5,dst-address/1m40s routing-mark=port6 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.8 dst-limit=\
1,5,dst-address/1m40s routing-mark=port7 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.9 dst-limit=\
1,5,dst-address/1m40s routing-mark=port8 to-addresses=192.168.2.254
add action=dst-nat chain=dstnat dst-address=192.168.11.10 dst-limit=\
1,5,dst-address/1m40s routing-mark=port9 to-addresses=192.168.2.254
add action=masquerade chain=srcnat out-interface=ether2
add action=masquerade chain=srcnat out-interface=ether3
add action=masquerade chain=srcnat out-interface=ether4
add action=masquerade chain=srcnat out-interface=ether5
add action=masquerade chain=srcnat out-interface=ether8
add action=masquerade chain=srcnat out-interface=ether6
add action=masquerade chain=srcnat out-interface=ether7
add action=masquerade chain=srcnat out-interface=ether9
add action=masquerade chain=srcnat out-interface=ether10
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port1 \
to-addresses=192.168.11.2
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port2 \
to-addresses=192.168.11.3
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port3 \
to-addresses=192.168.11.4
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port4 \
to-addresses=192.168.11.5
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port5 \
to-addresses=192.168.11.6
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port6 \
to-addresses=192.168.0.117
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port7 \
to-addresses=192.168.11.8
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port8 \
to-addresses=192.168.11.9
add action=src-nat chain=srcnat out-interface=ether1 routing-mark=port9 \
to-addresses=192.168.11.10
/ip route
add distance=1 dst-address=192.168.2.0/24 gateway=ether2 routing-mark=port1
add distance=1 dst-address=192.168.2.0/24 gateway=ether3 routing-mark=port2
add distance=1 dst-address=192.168.2.0/24 gateway=ether4 routing-mark=port3
add distance=1 dst-address=192.168.2.0/24 gateway=ether5 routing-mark=port4
add distance=1 dst-address=192.168.2.0/24 gateway=ether6 routing-mark=port5
add distance=1 dst-address=192.168.2.0/24 gateway=ether7 routing-mark=port6
add distance=1 dst-address=192.168.2.0/24 gateway=ether10 routing-mark=port9
add distance=1 dst-address=192.168.2.0/24 gateway=ether8 routing-mark=port7
add distance=1 dst-address=192.168.2.0/24 gateway=ether9 routing-mark=port8
add distance=1 dst-address=192.168.11.0/24 gateway=bridge,ether1