Accessing my PC from internet(other PCs)
hellow guys,
I have a question. can I access my personel computer which is connected to internet via Speedigo(ISP). When i try to find my ip from terminal with ifconfig command it returns this ip: 192.168.1.21 and if i google with my ip it returns : 122.102.127.160 which I assume is public ip. But my question is what if i want to connect to my pc from a different one using internet how do i do that .. ?? I mean what is my real ip ? |
probably you will have a dynamic ip. It means you do not have an ip, but you will get one when you need it from service provider.
to solve your problem you will need a dyndns service, you can find several free provider, like www.no-ip.com and you need to configure your router also. (see http://dnslookup.me/dynamic-dns/ also) which port do you want to reach? |
Quote:
|
so you need to define, what do you mean by connect? How do you want to reach that host?
|
Quote:
|
to login you would need ssh, and you need to configure your router to redirect the request from outside to 192.168.1.21.
but we need to know which router you have. |
Once you have decided what sort of connection you want too make to your PC (ftp, http, ssh ...) you can find which port that sort of connection uses and configure "port forwarding" on your router so that it forwards all packets arriving from the Internet and addressed to that port to 192.168.1.21.
In this scenario, 192.168.1.21 had better be a fixed IP. If your PC is configured to get an address automatically (from a DHCP server) it might get a different address and your port forwarding would break. You could forward all packets to your PC but that would be scarily insecure and render your PC very open to attacks from the Internet. |
What device do you have between you and the ISPs modem? Is is Cable or DSL?
You may be behind a NAT router locally. The Internet (WAN) side may have the 122.102.127.160 address. You need to log into your router to make sure. Do you want to SSH into your home computer from the internet? You didn't explain what you mean by connect. Using ssh you can log in as if you are at the local computer. You can use scp or sftp remotely to transfer files. If that is the case, you need to configure your home router to redirect port 22 to your computer at 192.168.1.21. You also need to configure openssh on your home computer. Remotely you would use an ssh client (openssh on Linux, putty on Windows). (note: some people change the port on the router to a high numbered port. It will reduce the number of brute force attempts. Your router can transfer this traffic and translate the port number to port 22 on your local computer.) |
Quote:
|
and 122.102.127.160 is my public ip .. that keeps changing.
|
Your situation is very common. Most people have this. As above the term is dynamic IP. It can change but some people may find theirs stays constant but it is a whim of the ISP.
You have some device like a cable modem. On one side you have a public IP. That is what google reports. To get on the inside of your lan you have either selected or allowed a private IP range. The term is NAT but really it is a PNAT. Network Address Translation is the means to allow your Public IP to let ports and IP addresses to transverse the two IP ranges and back. Many posts on NAT. The second issue that was talked about is the ability to "find" your unique public ip address from the outside. As suggested the common method is to get a dynamic DNS. A FQDN is like www.google.com. Everyone on the planet can get to a server that can say what that IP is. To get to your dynamic IP you need the help of a third party. They provide either free or slight cost way to have a unique name. They also provide some means to track your IP changes. Not all support linux. Some makers or equipment like modems also provide a built in account for some DDNS services. Your modem manual would tell that. Once you get your DDNS account, you then need to setup a program on the local computer that can track the IP and report back to DDNS service. Then when you go to your computer name (given by ddns company) you can get to your home IP. It may be like bobo.ddns.org or such. Then you need to configure your modem to forward ports based on the service that you need. Some ISP's block some ports inbound. |
Try to point your web browser at "192.168.1.1" or "192.168.0.1". Are you in an appt where several users are on the LAN? Having an local IP of 192.168.1.21 seems to imply that there are other IP addresses assigned. If you are all sharing a router, you may not be able to configure port forwarding.
run "sudo /sbin/ifconfig". Does the NIC have an ethernet connection or ppoe? |
Quote:
Code:
[nos@Olympians ~]$ ifconfig |
Please run "ip route show".
That will show what the default gateway IP address is. If you don't control your gateway router, you won't be able to forward ports. However, there might be a router located where the cable enters your home. My parents have a wireless router located in the utility room. |
All times are GMT -5. The time now is 09:09 PM. |