开发者

I know the ip of my router. My laptop is one of the devices connected to the router. What is my static ip? [closed]

开发者 https://www.devze.com 2023-02-21 13:29 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this 开发者_开发技巧question

I know the IP of my router. It is xx.xx.xxx.xxx My laptop is one of the devices connected to the router. My laptop gets a dynamic IP! Currently my IP is 192.168.0.7 and the IP gateway of my router is 192.168.0.1 How can I connect to my laptop from an external device?

http://192.168.0.7:80/xampp/server.php?data=25

This will only be executed if i am connected to the local network. I will get a 504 gateway timeout error when I connect to this from an external network. How can i overcome this!


192.168.* is an Internal Address block, which is why you're unable to access it from outside the network.

You can use sites like WhatIsMyIP or WhatIsMyIPAddress to view your External Address.

Note that you'll need to open/forward Port 80 in your Router and/or Firewall.


Set up port forwarding on your router of lets say port 1200. Forward port 1200 to the IP of your laptop (192.168.0.7)

Then on the external device to connect to your computer you would map it to address of your router + port forwarded to your laptop:

192.168.0.1:1200

And that should do it.

Edit** If your external device is on your internal network. If its not on your internal network and you are trying to access from outside through the internet. Then you need to get your external IP.. if your external ip is 69.69.69.69 then your external device would have to map to: 69.69.69.69:1200 to connect to your laptop

hth


You would have to use your router's port-forwarding feature as a proxy. Forward port 80 on your router to port 80 on your laptop; then external clients could talk to your laptop.


try running ipconfig on your conputer, it will tell you the external IP of the router.

That IP can be dynamic (as in it might change), so u might wanto get a static DNS name for your computer/router.


Dynamic DNS will give you what you want. It's a program you install on your laptop that sends it's IP to the site when it changes.


You need to set up port forwarding (on port 80) on your router to forward from its external IP to your laptop's internal IP (192.168.0.7). Then, when you connect from an external network you need to use your router's external IP. This can be obtained (when you're on the internal network) from whatismyip.com, or you can set up a hostname which resolves to the external IP via dyndns.com using their agent.

However I'd also recommend setting up either an actual static IP on your laptop or a DHCP reservation so that its internal IP is always the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消