Page 1 of 1

My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 3:31 pm
by Mirukai
As you can tell from the title, this is very annoying when setting up Dynu DNS, as it automatically routes to my laptop, which has no server software on it, instead of my Pi, which has Apache2 and a Minecraft Server on.

I did on my Pi:

Code: Select all

wget http://ipecho.net/plain -O - -q | pico plain
And it gave me 188.220.74.40, and then I went to IPChicken.com on my laptop and it gave me the same.

When you navigate to the IP, which I don't mind you doing, it puts you on the Apache2 Debian Default Page, but when using a DNS, it gets confused between the two devices! Please help me out!!

Thanks,
Mirukai

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 3:37 pm
by ghans
This is normal. Your home router does NAT just like
it was designed to.

Simply set up port forwarding correctly in your routers
control panel and Dynamic DNS will work (outside your
home network at least - some home routers don't support NAT
loopback).

You should always test your dynamic DNS setup
from a public library , Starbucks or over 3G.

ghans

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 4:00 pm
by Mirukai
I have a Sky Router, any way to do that NAT Loopback you're talking about on that?

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 4:07 pm
by ghans
"NAT loopback" or "NAT hairpin" is a router feature (and
it should be enabled by default ?!). You need the router
manual/product brief to know if your router has it.

Check your ISP website for router manuals (good luck) or
ask your ISP hotline. Perhaps you can use manuals for
the orginal "base" model your router was rebranded from.

Using services like "is this website down" or
"Online Port Scanners" is probably easier ... or lend or beg
a smartphone with 3G and test it that way.

ghans

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 4:19 pm
by Mirukai
Ah, cheers, but now I have another problem... My Apt-get is broken...

This is the error it throws at me.

Code: Select all

root@raspberrypi:/var/www/html# sudo apt-get install vsftpd
Reading package lists... Error!
W: Encountered status field in a non-version description
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
 
AGH!! What now?!

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 6:58 pm
by FlexibleSigmoid
Learn to search for your error messages, there's a ton of resources available if you Google the last error line.

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 7:41 pm
by Mirukai
Yup, googling last error message helped me, thanks! I will do this from now on.

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 05, 2016 9:29 pm
by DougieLawson
BTW, whatever you do, DO NOT open ports 20/21 to the public internet.

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Mon Jul 11, 2016 3:40 pm
by Mirukai
Why should I leave port 20 closed? I know FTP is meant to be secure, but why 20?

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Mon Jul 11, 2016 5:00 pm
by epoch1970
FTP active uses both 20/tcp and 21/tcp.
You can lookup ports for well-known protocols in /etc/services or over the internet.

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Tue Jul 12, 2016 6:06 pm
by DougieLawson
Mirukai wrote:Why should I leave port 20 closed? I know FTP is meant to be 100% totally, completely insecure, but why 20?
FTFY

If you need to accept files from the public internet use sshd/sftp or Apache2 with libcommons-fileupload

Both of those actually have a semblance of security.

Re: My RPi2's Public IP is the same as my laptop's!

Posted: Wed Jul 13, 2016 8:14 am
by mfa298
DougieLawson wrote:
Mirukai wrote:Why should I leave port 20 closed? I know FTP is meant to be 100% totally, completely insecure, but why 20?
FTFY

If you need to accept files from the public internet use sshd/sftp or Apache2 with libcommons-fileupload

Both of those actually have a semblance of security.
Although please change the pi users password first (and ideally create a new user and remove the pi user). Personally I'd also suggest not running ssh on port 22.

Having a pi with ssh on port 22 and the default pi:raspberry credentials accessible to the internet is arguably less secure than ftp. SSH is only as secure as it's been set up to be, if the credentials are easily guessable it's not very secure.