Community discussions

MikroTik App
 
JDunsOK
just joined
Topic Author
Posts: 1
Joined: Sun May 24, 2015 4:18 am

Port Forwarding Issues

Sun May 24, 2015 4:30 am

Greetings,

I just received my router and have it set up but am having issues with port forwarding. I have the three ports (80,1337,3306) forwarded through the nat in the firewall but when trying to connect from the outside I am getting 'Connection Refused' and am not able to figure out what is wrong.

Here is my /ip export:
# may/23/2015 20:22:09 by RouterOS 6.28
# software id = IQWZ-XJG9
#
/ip pool
add name=dhcp_pool1 ranges=192.168.150.100-192.168.150.254
/ip address
add address=X.X.180.21/28 comment="Cox WAN IP" interface=ether1 network=x.x.x.16
add address=192.168.150.1/24 comment="LAN IP Subnet" interface=bridge1 network=192.168.150.0
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=bridge1 lease-time=3d name=dhcp1
/ip dhcp-server network
add address=192.168.150.0/24 dns-server=192.168.150.1 gateway=192.168.150.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip firewall address-list
add address=192.168.150.0/24 list=LocalLAN
add address=0.0.0.0/8 comment="Self-Identification [RFC 3330]" disabled=yes list=bogons
add address=127.0.0.0/16 comment="Loopback [RFC 3330]" disabled=yes list=bogons
add address=169.254.0.0/16 comment="Link Local [RFC 3330]" disabled=yes list=bogons
add address=192.0.2.0/24 comment="Reserved - IANA - TestNet1" disabled=yes list=bogons
add address=192.88.99.0/24 comment="6to4 Relay Anycast [RFC 3068]" disabled=yes list=bogons
add address=198.18.0.0/15 comment="NIDB Testing" disabled=yes list=bogons
add address=198.51.100.0/24 comment="Reserved - IANA - TestNet2" disabled=yes list=bogons
add address=203.0.113.0/24 comment="Reserved - IANA - TestNet3" disabled=yes list=bogons
/ip firewall filter
add chain=input comment="Accept established connections" connection-state=established
add chain=input comment="Accept related connections" connection-state=related
add action=drop chain=input comment="Drop invalid connections" connection-state=invalid
add chain=input comment=UDP protocol=udp
add chain=input comment="Allow limited pings" limit=50/5s,2 protocol=icmp
add action=drop chain=input comment="Drop excess pings" protocol=icmp
add chain=input comment="SSH for secure shell" dst-port=22 protocol=tcp
add chain=input comment=Apache dst-port=80 protocol=tcp
add action=log chain=input comment="Log everything else" log-prefix="DROP INPUT"
add action=drop chain=input comment="Drop everything else"
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=dst-nat chain=dstnat dst-port=80 in-interface=ether1 protocol=tcp to-addresses=192.168.150.55 to-ports=80
add action=dst-nat chain=dstnat dst-port=1337 in-interface=ether1 protocol=tcp to-addresses=192.168.150.55 to-ports=1337
add action=dst-nat chain=dstnat dst-port=3306 in-interface=ether1 protocol=tcp to-addresses=192.168.150.55 to-ports=3306
/ip route
add distance=1 gateway=X.X.180.17
/ip service
set www port=9999
Any assistance is appreciated.
 
mocando
just joined
Posts: 13
Joined: Thu Jun 26, 2014 1:11 am

Re: Port Forwarding Issues

Mon May 25, 2015 11:19 pm

Hi JDunsOK,

The config seems to be correct.

Have you tried connecting to apache directly without router? You have to be sure that your ISP do not block those ports.

Regards