Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
I dont have any idea which port i am going to connect .. in fact all I am trying to do is learning. Just trying to figure out how things works. and yes that post is useful ! thanks a lot mate !
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.)
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.)
it is a cable. and its not a modem (i mean they have just given me cable). Its just a local company that provides wireless broadband to people. basically they just put a decive on the roof attached with a cable that is forwared to my pc.
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?
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.