Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-18-2012, 04:43 AM
|
#1
|
|
Member
Registered: Apr 2010
Posts: 30
Rep:
|
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 ?
|
|
|
|
04-18-2012, 05:09 AM
|
#2
|
|
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 2,882
|
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?
Last edited by pan64; 04-18-2012 at 05:12 AM.
|
|
|
1 members found this post helpful.
|
04-19-2012, 03:10 AM
|
#3
|
|
Member
Registered: Apr 2010
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
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 !
|
|
|
|
04-19-2012, 03:11 AM
|
#4
|
|
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 2,882
|
so you need to define, what do you mean by connect? How do you want to reach that host?
|
|
|
|
04-19-2012, 04:28 AM
|
#5
|
|
Member
Registered: Apr 2010
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
so you need to define, what do you mean by connect? How do you want to reach that host?
|
In a way that I can access the given user's files, dirs .. more like login as that user. Am I clear ?? lol I hope I am !!
|
|
|
|
04-19-2012, 04:36 AM
|
#6
|
|
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 2,882
|
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.
|
|
|
|
04-19-2012, 04:37 AM
|
#7
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,367
|
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.
|
|
|
|
04-19-2012, 04:42 AM
|
#8
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.)
|
|
|
|
04-19-2012, 07:35 AM
|
#9
|
|
Member
Registered: Apr 2010
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
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.
|
|
|
|
04-19-2012, 07:37 AM
|
#10
|
|
Member
Registered: Apr 2010
Posts: 30
Original Poster
Rep:
|
and 122.102.127.160 is my public ip .. that keeps changing.
|
|
|
|
04-19-2012, 09:56 AM
|
#11
|
|
Guru
Registered: Mar 2008
Posts: 8,721
|
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.
|
|
|
|
04-20-2012, 03:11 AM
|
#12
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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?
|
|
|
|
04-21-2012, 01:21 AM
|
#13
|
|
Member
Registered: Apr 2010
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
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?
|
ifconfig output
Code:
[nos@Olympians ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
inet 192.168.1.21 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::219:21ff:fe1e:90b9 prefixlen 64 scopeid 0x20<link>
ether 00:19:21:1e:90:b9 txqueuelen 1000 (Ethernet)
RX packets 2375244 bytes 2445293588 (2.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1974121 bytes 353399601 (337.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 base 0xec00
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 metric 1
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 104 bytes 6240 (6.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 104 bytes 6240 (6.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
|
|
|
04-21-2012, 03:29 AM
|
#14
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:39 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|