0

I forwarded the following ports on my router for my linux server which has a static ip address.

TCP  21   FTP
TCP  22   SFTP
TCP  80   HTTP
TCP  115

Before enabling these rules I could already access my website from outside the network via the external ip address of the server (being the same as the router), but couldn't connect to it via FTP or SFTP. When trying from inside the same network however, both the website (HTTP) as well as FTP and SFTP worked just fine using the external ip address.

But after forwarding the ports on the router FTP/SFTP and HTTP work from outside the network but from inside the network only HTTP works.

So my connecting possibilities just swapped. Is there any chance I can get all of them working at the same time?

Network Setup:

           domain.com        
           176.179.24.10      176.179.24.10
Internet---> Router----------> Server: static ip (same as router, with domain.com linked to it)
    |  Centro_grande_v2 |
    |                   |     192.168.1.101
    |                   L----> Macbook: can view domain.com in browser, but cannot connect with ssh
    V
 Computer: Can view domain.com in browser and can connect with ssh
5
  • 1
    What does the network setup actually look like? Commented Jan 22, 2017 at 1:22
  • Is this what you mean by network setup?
    – Nightmare
    Commented Jan 22, 2017 at 2:29
  • Router and server cannot have same static IP addresses. Please show exactly what the interfaces are on router and server, and the subnets and addresses for devices. Commented Jan 22, 2017 at 7:59
  • Can you please give write your router name and version Commented Jan 22, 2017 at 10:33
  • type: Centro_grande_v2 Firmware-Version: 9.0.10h2d26
    – Nightmare
    Commented Jan 22, 2017 at 11:50

2 Answers 2

0

I decided to try and rewrite the port fowarding rule on my router so I removed it and tested all of the described connections and everything is working now from outside and inside the routers network.

I don't know why this is the case since I had to enable this forwarding rule in the first place to solve the problem of being able to connect from outside the network.

0

I think you need to set your router DNS configuration, but first your box firwall settings and be sure they are open and that the services that belong to them are working example (check that the FTP has been started).

Now go and check the port forwarding in your Router then check your router DNS setting and set you domain there with your local static IP to your box

some router DNS will not except the DNS setting of *.domain.com so you have to set every alias you will use there like this:

      Domain      Local IP
domain.com     192.168.1.100
ftp.domain.com 192.168.1.100
www.domain.com 192.168.1.100

You have to understand that this setting only so you can work with your site from within a local network it will not effect the outside world.

-- There is one more thing when you forwarded your ports on your Router, did you put the Internal host/ip to your box local network address example (192.168.1.100)

-- Look here for your Router settings https://www.swisscom.ch/en/residential/help/internet/netzwerkeinstellungen.html

4
  • The port-forwarding is already working, since I can connect when I am outside the network the server is in.
    – Nightmare
    Commented Jan 22, 2017 at 2:36
  • I don't quite understand where to put this domain information... The problem is, the server has the external ip of the network, so it has no local ip.
    – Nightmare
    Commented Jan 22, 2017 at 2:38
  • @Nightmare, "The problem is, the server has the external ip of the network, so it has no local ip." Of course it does. If you are forwarding ports, you are forwarding them to an internal IP address. You DNS configuration should be made on the DNS server that serves your network, often on the router.
    – Ron Maupin
    Commented Jan 22, 2017 at 3:23
  • So what am I supposed to change in this DNS configuration? And where do I find it?
    – Nightmare
    Commented Jan 22, 2017 at 3:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .