LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-12-2015, 11:21 AM   #1
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Rep: Reputation: Disabled
Cent OS 5.9 + Firewall


Hello Guys,

Here is my situation; I'm using Cent OS 5.9 to run my PBX system. I'm trying to do port forwarding directly to my PBX but can't get thru. So far I can get to the router , but that is it.

My config is as follow :

Router(CISCO RV042) 192.168.2.1
SERVER/PBX 192.168.2.2

I'm forwarding the following ports :

5060 - 5090
10000 - 20000
9022 - 9022
8090 - 8090
9001 - 9001
443 - 443
4569 - 4569

am I missing something?

Thank You !
 
Old 03-12-2015, 08:58 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
What is the network for your CentOS server? How you have setup the rules for forwarding? And isn't it router responsibility to forward the packets received from CentOS to PBX. I mean that is the device which is acting as bridge. If CentOS and PBX are in separate network (which from your post obviously appears to be otherwise router wouldn't be in picture) then obviously it has to pass via router.
 
Old 03-12-2015, 11:59 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
if at all possible upgrade to 5.11 ASAP!!!

cent dose NOT support old versions
There have been NO security updates for 5.9 since Oct.2013
 
Old 03-13-2015, 10:54 AM   #4
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
What is the network for your CentOS server? How you have setup the rules for forwarding? And isn't it router responsibility to forward the packets received from CentOS to PBX. I mean that is the device which is acting as bridge. If CentOS and PBX are in separate network (which from your post obviously appears to be otherwise router wouldn't be in picture) then obviously it has to pass via router.
I dont think i understood you well . But the router and the Server are on the same network , I plug a camera to the network and port forward works fine !


Here is a screen shot of the FW !


Action
Condition
Move
Add


Jump to chain fail2ban-BadBots
If protocol is TCP and destination ports are 80,443

Jump to chain fail2ban-VSFTPD
If protocol is TCP and destination port is 21

Jump to chain fail2ban-APACHE
If protocol is TCP

Jump to chain fail2ban-ASTERISK
Always

Jump to chain fail2ban-SSH
If protocol is TCP and destination port is 22

Accept
If input interface is not eth0

Accept
If protocol is TCP and TCP flags ACK (of ACK) are set

Accept
If state of connection is ESTABLISHED

Accept
If state of connection is RELATED

Accept
If protocol is UDP and destination port is 1024:65535 and source port is 53

Accept
If protocol is ICMP and ICMP type is 0

Accept
If protocol is ICMP and ICMP type is 3

Accept
If protocol is ICMP and ICMP type is 4

Accept
If protocol is ICMP and ICMP type is 11

Accept
If protocol is ICMP and ICMP type is 12

Accept
If protocol is TCP and source is 50.242.166.176/29 and destination port is 80

Accept
If protocol is TCP and destination port is 113

Accept
If protocol is TCP and source is 192.168.1.0/24 and destination port is 80

Accept
If protocol is TCP and destination port is 443

Accept
If protocol is TCP and destination port is 9080

Accept
If protocol is UDP and destination port is 4569

Accept
If protocol is UDP and destination port is 1723

Accept
If protocol is UDP and destination port is 5060:5090

Accept
If protocol is UDP and destination port is 10000:20000

Accept
If protocol is TCP and destination port is 5038

Accept
If protocol is UDP and destination port is 123

Accept
If protocol is UDP and source is 192.168.1.0/24 and destination port is 69

Accept
If protocol is TCP and destination port is 9022

Accept
If protocol is UDP and destination port is 5353

Accept
If protocol is TCP and destination port is 4445

Accept
If protocol is TCP and source is 38.126.217.14 and destination port is 22

Accept
If protocol is TCP and source is 70.90.58.250 and destination port is 22

Accept
If protocol is TCP and source is 198.161.132.210 and destination port is 22

Accept
If protocol is TCP and source is 192.168.1.0/24 and destination port is 22

Accept
If protocol is TCP and source is 50.242.166.176/29 and destination port is 9001

Accept
If protocol is TCP and source is 70.90.58.250 and destination port is 9001

Accept
If protocol is TCP and source is 38.126.217.14 and destination port is 9001

Accept
If protocol is TCP and source is 38.126.217.3 and destination port is 9001

Accept
If protocol is TCP and source is 192.168.1.0/24 and destination port is 9001

Accept
If protocol is TCP and source is 198.161.132.210 and destination port is 9001

Accept
If protocol is UDP and source is 50.242.166.176/29 and destination port is 69

Accept
If protocol is TCP and source is 50.242.166.176/29 and destination port is 22

---------- Post added 03-13-15 at 11:55 AM ----------

Quote:
Originally Posted by John VV View Post
if at all possible upgrade to 5.11 ASAP!!!

cent dose NOT support old versions
There have been NO security updates for 5.9 since Oct.2013


Ok, i'll try ! What do i get from the update?
 
Old 03-13-2015, 11:09 AM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
So you have got PBX/Server --> Router --> Some external source (you mentioned Camera, am just not sure if that falls in here). You also mentioned that you connect Camera to the network and it works fine. So where the issue is?

From where to where you are trying to forward the packets? If it is an external source terminating at your router and you want those packets to be forwarded to you PBX/Server.

If you could mention the flow it will be easy to understand.

As John VV mentioned you wouldn't get security updates. So upgrading the system to 5.11 will enable you to get security updates for your system. Infact I would suggest migrating to CentOS 6.X if at all possible, I mean if your application works on 6.X then better move to that.
 
Old 03-13-2015, 11:44 AM   #6
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
So you have got PBX/Server --> Router --> Some external source (you mentioned Camera, am just not sure if that falls in here). You also mentioned that you connect Camera to the network and it works fine. So where the issue is?

From where to where you are trying to forward the packets? If it is an external source terminating at your router and you want those packets to be forwarded to you PBX/Server.

If you could mention the flow it will be easy to understand.

As John VV mentioned you wouldn't get security updates. So upgrading the system to 5.11 will enable you to get security updates for your system. Infact I would suggest migrating to CentOS 6.X if at all possible, I mean if your application works on 6.X then better move to that.


It goes like this :

ISP-> CISCO ROUTER (RV042) -> From the LAN ports on the ROUTER LAN 1 goes to the camera , LAN 2 goes to the server.

If i try to access the server within the network i have no problem , however when i try to do it from outside i cant get thru. Thats why i thought it had something to do with my FW settings, what do you think ?
 
Old 03-13-2015, 12:00 PM   #7
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
I am assuming that you have got a static IP configured on your router. Yes, if you are not able to access externally but works fine internally then it is your router which is blocking the traffic.

Here is the link which will help you to test open ports: http://www.yougetsignal.com/tools/open-ports/
 
Old 03-13-2015, 01:31 PM   #8
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
I am assuming that you have got a static IP configured on your router. Yes, if you are not able to access externally but works fine internally then it is your router which is blocking the traffic.

Here is the link which will help you to test open ports: http://www.yougetsignal.com/tools/open-ports/


Correct ! I've got a static IP Address, if it was the router then i wouldnt be able to access the camera right ?
 
Old 03-13-2015, 01:50 PM   #9
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
As you said LAN 1 goes to camera and it works fine when you access it from internet, that means that particular Device (camera) is accessible and router is not blocking any traffic to camera. However, it is blocking traffic coming from the internet to reach to the server.

An easy way to check that out is first check from the site I mentioned earlier whether port which you want to be forwarded to your server are open on the router or not. Next, take a tcpdump on the server and see if the packets are reaching to the server. If they are getting dropped / reject on the server end then it is not your router but your local firewall. If they are not at all reaching the server then it is your router.

For analyzing the packet trace capture using tcpdump, I would suggest using wireshark as it is easy to analyze using that tool.
 
Old 03-13-2015, 05:07 PM   #10
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
As you said LAN 1 goes to camera and it works fine when you access it from internet, that means that particular Device (camera) is accessible and router is not blocking any traffic to camera. However, it is blocking traffic coming from the internet to reach to the server.

An easy way to check that out is first check from the site I mentioned earlier whether port which you want to be forwarded to your server are open on the router or not. Next, take a tcpdump on the server and see if the packets are reaching to the server. If they are getting dropped / reject on the server end then it is not your router but your local firewall. If they are not at all reaching the server then it is your router.

For analyzing the packet trace capture using tcpdump, I would suggest using wireshark as it is easy to analyze using that tool.



I tried the WireShark ! I got the dump file ! where do i see if the packets are being dropped or not ?
 
Old 03-14-2015, 05:26 AM   #11
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
It is very easy, look for the packets that you were expecting on the server. If you see in the trace then it has reached the server but server did not reply, drop or reject. If you don't see those packet at all then you have to go back to the router and check why it is not forwarding packets to the server.
 
Old 03-16-2015, 08:26 AM   #12
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
It is very easy, look for the packets that you were expecting on the server. If you see in the trace then it has reached the server but server did not reply, drop or reject. If you don't see those packet at all then you have to go back to the router and check why it is not forwarding packets to the server.


I found it , The packets are reaching the server ! So i guess i have to look into the server's FW settings ? What do you think ?

Thank You !
 
Old 03-16-2015, 08:32 AM   #13
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Yes, that is correct. If packets are reaching server and then it is getting dropped / reject then the issue is at server end. Router is doing its job of forwarding packets to the destination on the defined ports.
 
Old 03-16-2015, 08:37 AM   #14
alez.amores
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
Yes, that is correct. If packets are reaching server and then it is getting dropped / reject then the issue is at server end. Router is doing its job of forwarding packets to the destination on the defined ports.



I'll keep trying , thanks for all your help !!
 
  


Reply



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
how to upgrade cent os 5.4 32 bit to cent os 5.8 64 bit h.dilshad Linux - Newbie 15 03-20-2013 03:27 PM
[SOLVED] Cent 5.8 Firewall allowing 224.0.0.251 on port 5353 leslie_jones Linux - Security 7 04-10-2012 11:04 AM
CENT OS help meil Linux - Server 4 09-12-2011 01:00 AM
Cent OS help aggrishabh Linux - Newbie 1 03-29-2011 04:24 AM
Cent OS jolly1702 Linux - Newbie 3 08-24-2008 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:26 AM.

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