Port forwarding for beginner
Posted: Wed Aug 15, 2018 10:01 pm
Hello the I'm new to mikrotik I'm trying to set up port forwarding on my cctv here my script if that helps
/export
/interface bridge
add admin-mac=E4:8D:8C:59:B6:B2 auto-mac=no name=bridge
/interface ethernet
set [ find default-name=ether1 ] name="BT Modem"
set [ find default-name=ether3 ] name="Bedrooms AP"
set [ find default-name=ether23 ] name=Cctv
set [ find default-name=ether2 ] name="Lounge AP"
/interface pppoe-client
add add-default-route=yes disabled=no interface="BT Modem" name=pppoe-out1 use-peer-dns=yes user=\
bthomehub@btbroadband.com
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=vpn ranges=192.168.89.2-192.168.89.255
add name=dhcp ranges=10.3.0.3-10.3.0.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=dhcp1
/interface l2tp-server server
set enabled=yes ipsec-secret= use-ipsec=yes
/interface pptp-server server
set enabled=yes
/interface sstp-server server
set default-profile=default-encryption enabled=yes
/ip address
add address=10.3.0.1/24 comment=defconf interface=bridge network=10.3.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-server lease
add address=10.3.0.10 client-id=1:4c:bd:8f:fe:39:1a mac-address=4C:BD:8F:FE:39:1A server=dhcp1
/ip dhcp-server network
add address=10.3.0.0/24 gateway=10.3.0.1 netmask=24
/ip firewall address-list
add address=0.0.0.0/8 comment="Self-Identification [RFC 3330]" list=Bogons
add address=10.0.0.0/8 comment="Private[RFC 1918] - CLASS A # Check if you need this subnet before enable it" list=Bogons
add address=127.0.0.0/8 comment="Loopback [RFC 3330]" list=Bogons
add address=169.254.0.0/16 comment="Link Local [RFC 3330]" list=Bogons
add address=172.16.0.0/12 comment="Private[RFC 1918] - CLASS B # Check if you need this subnet before enable it" list=\
Bogons
add address=192.0.2.0/24 comment="Reserved - IANA - TestNet1" list=Bogons
add address=192.88.99.0/24 comment="6to4 Relay Anycast [RFC 3068]" list=Bogons
add address=198.18.0.0/15 comment="NIDB Testing" list=Bogons
add address=198.51.100.0/24 comment="Reserved - IANA - TestNet2" list=Bogons
add address=203.0.113.0/24 comment="Reserved - IANA - TestNet3" list=Bogons
add address=224.0.0.0/4 comment="MC, Class D, IANA # Check if you need this subnet before enable it" list=Bogons
/ip firewall filter
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=input port=69 protocol=udp
add action=accept chain=forward port=69 protocol=udp
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface="BT Modem"
add action=drop chain=forward comment="Drop to bogon list" dst-address-list=Bogons
add action=accept chain=input protocol=icmp
add action=accept chain=input connection-state=established
add action=accept chain=input connection-state=related
add action=drop chain=input in-interface="BT Modem"
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN
add action=dst-nat chain=dstnat dst-port=3999 in-interface=bridge protocol=tcp to-addresses=10.3.0.10 to-ports=80
/export
/interface bridge
add admin-mac=E4:8D:8C:59:B6:B2 auto-mac=no name=bridge
/interface ethernet
set [ find default-name=ether1 ] name="BT Modem"
set [ find default-name=ether3 ] name="Bedrooms AP"
set [ find default-name=ether23 ] name=Cctv
set [ find default-name=ether2 ] name="Lounge AP"
/interface pppoe-client
add add-default-route=yes disabled=no interface="BT Modem" name=pppoe-out1 use-peer-dns=yes user=\
bthomehub@btbroadband.com
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=vpn ranges=192.168.89.2-192.168.89.255
add name=dhcp ranges=10.3.0.3-10.3.0.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=dhcp1
/interface l2tp-server server
set enabled=yes ipsec-secret= use-ipsec=yes
/interface pptp-server server
set enabled=yes
/interface sstp-server server
set default-profile=default-encryption enabled=yes
/ip address
add address=10.3.0.1/24 comment=defconf interface=bridge network=10.3.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-server lease
add address=10.3.0.10 client-id=1:4c:bd:8f:fe:39:1a mac-address=4C:BD:8F:FE:39:1A server=dhcp1
/ip dhcp-server network
add address=10.3.0.0/24 gateway=10.3.0.1 netmask=24
/ip firewall address-list
add address=0.0.0.0/8 comment="Self-Identification [RFC 3330]" list=Bogons
add address=10.0.0.0/8 comment="Private[RFC 1918] - CLASS A # Check if you need this subnet before enable it" list=Bogons
add address=127.0.0.0/8 comment="Loopback [RFC 3330]" list=Bogons
add address=169.254.0.0/16 comment="Link Local [RFC 3330]" list=Bogons
add address=172.16.0.0/12 comment="Private[RFC 1918] - CLASS B # Check if you need this subnet before enable it" list=\
Bogons
add address=192.0.2.0/24 comment="Reserved - IANA - TestNet1" list=Bogons
add address=192.88.99.0/24 comment="6to4 Relay Anycast [RFC 3068]" list=Bogons
add address=198.18.0.0/15 comment="NIDB Testing" list=Bogons
add address=198.51.100.0/24 comment="Reserved - IANA - TestNet2" list=Bogons
add address=203.0.113.0/24 comment="Reserved - IANA - TestNet3" list=Bogons
add address=224.0.0.0/4 comment="MC, Class D, IANA # Check if you need this subnet before enable it" list=Bogons
/ip firewall filter
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=input port=69 protocol=udp
add action=accept chain=forward port=69 protocol=udp
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface="BT Modem"
add action=drop chain=forward comment="Drop to bogon list" dst-address-list=Bogons
add action=accept chain=input protocol=icmp
add action=accept chain=input connection-state=established
add action=accept chain=input connection-state=related
add action=drop chain=input in-interface="BT Modem"
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN
add action=dst-nat chain=dstnat dst-port=3999 in-interface=bridge protocol=tcp to-addresses=10.3.0.10 to-ports=80