Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I configured a router R1 to work as a repeater, I connected an internet router R2 from an ISP to it (R1). The internet router R2 was assigned a static IP (41.58.163.84) by the ISP.

I run an intranet application that is connected to from R1, I assigned a static IP (192.168.1.5) to the host (PC) which serves as a server for intranet application so that other PCs on the R1 network can reach it using the static IP.

Now, I want to be able to reach the intranet application from the internet. I configured port forwarding on the internet router R2, I set the internal host to the static IP of the PC acting as a server for the intranet application.

When I try to connect to MySQL from the internet using the static IP (41.58.163.84) from my ISP as host, I get the error

cannot connect to MySQL server at '41.58.163.84' (10061) 

What are my doing wrong, and how can I connect the MySQL server?

share|improve this question
add comment

2 Answers

A few things you can check:

  1. Can you connect to "Server" that is connected on R1 from within your own LAN? (From other computer connected to R1 or computer directly connected to R2)
  2. Try Thomas' suggestion and temporarily turn off firewall on Server, and try #1 again.
  3. Set up Port Forwarding from R1 to the Server IP:Port - You did mention you have done it, but just to be complete
  4. From inside your LAN: Can you connect to the MySQL Server using the external IP address (so from a PC connected to either R1 or R2, connect to MySQL with address: 41.58.163.84:port) and see if that works)
  5. From outside your LAN: as per #4
  6. Does your MySQL is hardened by only allowing access from certain IP address? (MySQL can have its own rule about allowing certain users to connect from certain IP address/range)

Also since you didn't mention the setting / IP range for R1 and R2 (yes you did mention it is simply repeating, but what you think, and what it actually doing may be different).

Lets assume some IP numbers - with R1 and R2 on the same Subnet (192.168.1.x/255.255.255.0):
R1 - 192.168.1.2
R2 - 192.168.1.1 - acting as gateway to internet
Server - 192.168.1.5 (running MySQL on port 3306)

Simple port forwarding on R2 to 192.168.1.5:port will work (this is similar to my own home set up but I have a NAS server instead)

If you have R1 and R2 on different subnet eg.
R1 on 192.168.1.x
R2 on 192.168.2.x
This needs double-router port forwarding. You need to set up double port forwarding. One from R2 to R1. And then another from R1 to Server. The full instruction is discussed here: http://portforward.com/help/doublerouterportforwarding.htm

... if I can think of any other things to check, I'll add an edit.. but for now, give those a try and hope it helps.

share|improve this answer
    
Thanks for the answer. Yes I can connect to the server connected on R1. My firewall is disabled. The port forwarding was configured on R2 not R1 since the remote connection comes through it. R1 acts as a repeater. For question 4, no, I cannot connect to the MySQL server using the external IP within the LAN, and outside it. The MySQL allows connection from any host. –  Chibuzo Sep 27 '13 at 7:20
    
From what you told me, all I can think of is your port forwarding is not done correctly. One thing we can use to test is go to grc.com and check their "Shields Up". What that shields up does is to test your IP for open ports. Once you go into the Shields Up page, enter the MySQL Port and click on "User Specified Custom Port Probe". If it is showing as "Closed" or "Stealth" means your R2 Router is not doing its port forwarding correctly. Also, you don't happen to use setting like here do you? -> portforward.com/help/doublerouterportforwarding.htm –  Darius Sep 27 '13 at 7:43
add comment

Firewall? First thing I'd think of. Also your modem/router might be blocking the connection.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.