LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   server firewall rules (https://www.linuxquestions.org/questions/linux-newbie-8/server-firewall-rules-744788/)

qwertyjjj 08-03-2009 11:22 AM

server firewall rules
 
I am going to have squid proxy on my server and am wondering what firewall rules to set up.
The host has a firewall tracking at the entry to their network. However, I can have an extra one on my server.
Is it worth it?
Would I only open up port 80 for the proxy?

At the moment I have this:

Local Port

Protocol

Action

Status
1 All Any 22 TCP Allow Active
2 All Any 80 TCP Allow Active
3 All Any 443 TCP Allow Active
4 All Any 8443 TCP Allow Active
5 All 53 Any UDP Allow Active
6 All 123 Any UDP Allow Active
7 All ICMP Allow Active

kirukan 08-03-2009 11:47 AM

Allow your proxy listening port(in default 3128)

qwertyjjj 08-03-2009 11:59 AM

Quote:

Originally Posted by kirukan (Post 3629772)
Allow your proxy listening port(in default 3128)

I have added 2 IPs. One for the proxy server, one for the SSH.
I can't ping the ssh IP. It has no reverse look up, could that be the issue?
I thought for security it was supposed to have no reverse lookup but then how can the ping command find it?

repo 08-03-2009 12:01 PM

How is the network set up ?

qwertyjjj 08-03-2009 12:02 PM

Quote:

Originally Posted by repo (Post 3629800)
How is the network set up ?

Set up by a host company.

repo 08-03-2009 12:04 PM

Quote:

I have added 2 IPs. One for the proxy server, one for the SSH.
What ip's did you assigned?
Are they public ip's?

qwertyjjj 08-03-2009 12:05 PM

Quote:

Originally Posted by repo (Post 3629809)
What ip's did you assigned?
Are they public ip's?

I believe so. I can ping one of them, the one that has reverse lookup.
Can't ping the other.

repo 08-03-2009 12:07 PM

Where did you get the ip's from?
do you use 192.168.xxx.xxx or 10.0.0.xxx or a public ip?
Did you assigned 2 ip's to the networkcard?
Why?

qwertyjjj 08-03-2009 12:22 PM

Quote:

Originally Posted by repo (Post 3629815)
Where did you get the ip's from?
do you use 192.168.xxx.xxx or 10.0.0.xxx or a public ip?
Did you assigned 2 ip's to the networkcard?
Why?

got them from the hosting company.
The addresses are 213.xxx.xxx.xxx - this I can ping
the other is 87.xxx.xxx.xxx
both public

repo 08-03-2009 12:30 PM

So the server has 1 networkcard with ip 212.xxx.xxx.xxx
You assigned the ip 87.xxx.xxx.xxx to what? are there 2 networkcards?
You connect to the server using ssh to ip 212.xxx.xxx.xxx from your home.

server => 212.xxx.xxx.xxx => internet => your home computer
Where did you setup 87.xxx.xxx.xxx ?

qwertyjjj 08-03-2009 01:23 PM

Quote:

Originally Posted by repo (Post 3629842)
So the server has 1 networkcard with ip 212.xxx.xxx.xxx
You assigned the ip 87.xxx.xxx.xxx to what? are there 2 networkcards?
You connect to the server using ssh to ip 212.xxx.xxx.xxx from your home.

server => 212.xxx.xxx.xxx => internet => your home computer
Where did you setup 87.xxx.xxx.xxx ?

I'm not sure how they set it up but I believe it's just an IP routing at their firewall maybe.
87.xxx.xxx.xxx is setup through their control panel and I can set up different firewall access rules.

I can ping and connect to 212 from home using SSH.
I cannot ping or connect to 87. but it does not have reverse lookup.

repo 08-03-2009 02:47 PM

Quote:

I cannot ping or connect to 87. but it does not have reverse lookup.
Seems to me 87.xxx.xxx.xxx is not routed correctly.
It has nothing to do with reverse lookup
Perhaps you can contact the hosting provider.

qwertyjjj 08-03-2009 07:45 PM

Quote:

Originally Posted by repo (Post 3630012)
Seems to me 87.xxx.xxx.xxx is not routed correctly.
It has nothing to do with reverse lookup
Perhaps you can contact the hosting provider.

Ok. I've sorted that now, was a config issue and also firewall issue.
Now...
a guide I read says
Quote:

Access

Never ever use standard ports or your main IP for shell access, and never use FTP.

Result? Every server requires at least two IP addresses - one for the httpd server that resolves from your web domain, and one for SSH (running on non-standard port). So we have:-

www.example.com A RECORD 123.123.123.123 (httpd binds to this)

.... and one further IP address, with no reverse lookup set in DNS for SSHd and for SSHd only. And not on port 22 - go for a random port > 1024.

What about FTP? What about it indeed. You don't need it if you have SSH - any half decent FTP client can tunnel in over SSH. It's called secure FTP or SFTP. FileZilla will do it.
My server also has the plesk control panel available on 443 and 8443.
SHould these ports be moved to only be accessible on the 2nd IP address?
So, in effect the shared IP only has the proxy server ports open?
To change the SSH port, does the SSH listening pot have to be changed in linux?


All times are GMT -5. The time now is 08:00 PM.