LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2018, 06:22 AM   #1
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Rep: Reputation: 31
Question Creating dynamic IP hosting


Dear all,
I wanted to setup my box as a host with dynamic ip using no-ip.com service so that I could ssh my box from anywhere outside, however for some reason no-ip said that port 22 wasn't open.

What I did:
1. Create a host at no-ip
2. Install no-ip service in the box to update the dynamic ip
3. Do port forwarding of my box at its router

I do netstat on the box, it said the port 22 was open. So it was according to Nmap scan, but the wizard in no-ip said that port 22 was close. I also try to ssh to my box, I couldn't get in.

What else did I miss?

regards
 
Old 02-23-2018, 06:38 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Check this again:
Quote:
Originally Posted by ethereal1m View Post
3. Do port forwarding of my box at its router
Depending on your router you may find that 22 may be used for remote management of the router and isn't available for forwarding. Try setting your router up to forward a different port (2222) to port 22 on your inside box and connect to that instead of the normal port 22.
 
1 members found this post helpful.
Old 02-23-2018, 07:02 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Is ssh running on your box and can you login locally on your LAN?

Did you allow port 22 access in the box's firewall?

Did you configure the box with a static IP address or use a DHCP address reservation in your router?

Did you use the correct IP of your box in router's forwarding rule?

Does your no-ip URL actually resolve to your WAN IP address?
 
1 members found this post helpful.
Old 02-24-2018, 04:50 AM   #4
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by michaelk View Post
Is ssh running on your box and can you login locally on your LAN?
Yes. I could ssh from 1 machine to another in LAN.

Quote:
Originally Posted by michaelk View Post
Did you allow port 22 access in the box's firewall?
Yes. I confirmed this by using nmap from my other machine in LAN.

Quote:
Originally Posted by michaelk View Post
Did you configure the box with a static IP address or use a DHCP address reservation in your router?
Yes. It is using DHCP address.

Quote:
Originally Posted by michaelk View Post
Did you use the correct IP of your box in router's forwarding rule?
Yes. I made sure the box address is in the forwarding setup.

Quote:
Originally Posted by michaelk View Post
Does your no-ip URL actually resolve to your WAN IP address?
Yes. I do "whatismyip", it matched with my no-ip host.

But when I test port 22 using this port checking took, it timed out. The no-ip software in the box said that it associated my no-ip address with the box LAN, but how can I make sure that? How I make sure that my router will route the traffic from outside to my box?
 
Old 02-24-2018, 04:51 AM   #5
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by TenTenths View Post
Check this again:

Depending on your router you may find that 22 may be used for remote management of the router and isn't available for forwarding. Try setting your router up to forward a different port (2222) to port 22 on your inside box and connect to that instead of the normal port 22.
tried that, it didn't work, I must miss something simple but important
 
Old 02-24-2018, 05:40 AM   #6
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Original Poster
Rep: Reputation: 31
I'm suspecting my modem is doing the blocking, but how can I check that?
 
Old 02-24-2018, 06:26 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
you could try temporarily disabling the firewall.
btw, i often fall into the trap that i
1) open the port on my router
but then forget to
2) open the port on my machine's (not the router's) firewall
 
1 members found this post helpful.
Old 02-24-2018, 08:15 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
You should be able to test ssh through the router using the nmap command from within your network. If that works you can check with your no-ip URL.

nmap WAN_IP_address -p 22

nmap no-ip_URL -p 22

I would add an address reservation in your routers DHCP setup. You might always see the same LAN address anyway but there is no guarantee.
 
Old 02-24-2018, 08:28 AM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You did not elaborate on the type of router you have. In some cases you must create a port forwarding rule, but also a rule which actually allows to pass that traffic through this forwarding rule.

Some routers do this implicitely (so you are not aware of it, you don't see it and you cannot change it), some routers do it automatically (like PFSense, and you cannot disable the rule) and some don't do it at all. Like IPtables. Are you sure the traffic is not only forwarded bu also allowed?

During testing, forget about no-ip DNS resolution. Use your IP address and once that works, you can use the name and see if it resolves properly. Likely it does, but exclude unknowns.

jlinkels
 
1 members found this post helpful.
Old 02-26-2018, 06:39 AM   #10
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Original Poster
Rep: Reputation: 31
hello... I ran nmap against the box from my other machine on LAN, and port 22 was open, which means firewall doesn't block the box and the router. However when I scan my WAN, it said port 22 was filtered, so were also other ports. I suspected that my modem did some kind of firewall, but when I disabled its firewall, it port was still filtered.

My router is cisco e1200,I don't know how to confirm if port forwarding works or not. Also my modem is technicolor cwa0101, seemed like this device did some port filtering, but not sure which one.

In my linux box ufw status is inactive and there is no policy in iptables -L.

So how can I pinpoint the cause of filtered port?
 
Old 02-26-2018, 06:44 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Is the Technicolor also a router?
 
Old 02-26-2018, 07:54 AM   #12
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by michaelk View Post
Is the Technicolor also a router?
it has 2 ports of LAN, 2 different networks, so it must be a router, right?
 
Old 02-26-2018, 08:08 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Not enough information to say either way. A quick search did not pop up anything on that part number.
 
Old 04-23-2018, 07:27 AM   #14
ethereal1m
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 312

Original Poster
Rep: Reputation: 31
hmm turn out that my ip provider block the port. So I use teamviewer instead....
 
  


Reply

Tags
dynamic dns



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hosting multiple subdomains on 1 dynamic IP ABL Linux - Server 2 05-16-2009 07:11 PM
Dynamic virtual hosting and ulr without www tomekf Linux - Server 5 10-16-2006 03:10 AM
dynamic IP/web hosting microsoft/linux Linux - Networking 1 09-25-2005 01:54 PM
need help about dynamic hosting alvi2 Linux - Networking 2 05-05-2005 10:58 AM
Hosting dynamic DNS Kostko Linux - Networking 6 12-15-2002 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration