Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| 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. |
|
 |
|
08-26-2009, 07:58 AM
|
#16
|
|
Member
Registered: Aug 2009
Posts: 30
Original Poster
Rep:
|
Here you go
Code:
Chain INPUT (policy ACCEPT 1113K packets, 236M bytes)
pkts bytes target prot opt in out source destination
14871 742K ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2710
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
tcp dpt:2700
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2700
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2700
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
tcp dpt:2700
142 24713 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
tcp spt:2700 state NEW,ESTABLISHED
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1250K packets, 836M bytes)
pkts bytes target prot opt in out source destination
|
|
|
|
08-26-2009, 08:04 AM
|
#17
|
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by a4kata
Here you go
Code:
Chain INPUT (policy ACCEPT 1113K packets, 236M bytes)
pkts bytes target prot opt in out source destination
14871 742K ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2710
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
tcp dpt:2700
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2700
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2700
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
tcp dpt:2700
142 24713 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
tcp spt:2700 state NEW,ESTABLISHED
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1250K packets, 836M bytes)
pkts bytes target prot opt in out source destination
|
Code:
14871 742K ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2710
looks ok.
does it work? if not you may have to add it without the --state flag or add NEW,ESTABLISHED to the states?
|
|
|
|
08-26-2009, 08:04 AM
|
#18
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
It seems fine. sso-service is the one that uses 2710 port.
But may I know what is the purpose of this all. These all are registered service ports and I have never touched these ports.
What do you want to gain from opening this port? You should be absolutely sure what port you want to open else it could be a big security risk.
|
|
|
|
08-26-2009, 08:08 AM
|
#19
|
|
Member
Registered: Aug 2009
Posts: 306
Rep:
|
Do a netstat -ntulp | grep "2710" or a lsof -i :2710
|
|
|
|
08-26-2009, 08:11 AM
|
#20
|
|
Member
Registered: Aug 2009
Posts: 30
Original Poster
Rep:
|
Yes, I want only 2710 port . I have mistaken 2710 with 2700 now must I close 2700 port ?
|
|
|
|
08-26-2009, 08:14 AM
|
#21
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
Yes of course. You should not open ports unless you need them or system needs them. I would say do not touch these ports unless you absolutely know what you are doing and how it is going to affect the system and complete setup.
|
|
|
|
08-26-2009, 08:15 AM
|
#22
|
|
Member
Registered: Aug 2009
Posts: 306
Rep:
|
Well close 2700 if you wish to
iptables -t filter -I INPUT -p tcp --dport 2700 -j DROP
|
|
|
|
08-26-2009, 09:00 AM
|
#23
|
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by kdelover
Well close 2700 if you wish to
iptables -t filter -I INPUT -p tcp --dport 2700 -j DROP
|
you are in danger of your iptables rules becoming a real mess.
have you actually saved any of these rules??
if not, i suggest restarting iptables so it removes these newly added rules, then readding the rule you need, then issuing an
If you have saved the rules, edit /etc/sysconfig/iptables and remove the lines of rules you dont need (port 2700) then restart the iptables firewall
|
|
|
|
08-26-2009, 09:06 AM
|
#24
|
|
Member
Registered: Aug 2009
Posts: 30
Original Poster
Rep:
|
I turn on the firewall it seems well :
Code:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
33033 4588K RH-Firewall-1-INPUT all -- * * 0.0.0.0/0 0.
0.0.0/0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 RH-Firewall-1-INPUT all -- * * 0.0.0.0/0 0.
0.0.0/0
Chain OUTPUT (policy ACCEPT 37326 packets, 26M bytes)
pkts bytes target prot opt in out source destination
Chain RH-Firewall-1-INPUT (2 references)
pkts bytes target prot opt in out source destination
79 5442 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
icmp type 255
0 0 ACCEPT esp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT ah -- * * 0.0.0.0/0 0.0.0.0/0
321 29981 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251
udp dpt:5353
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0
udp dpt:631
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
tcp dpt:631
28268 4325K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
state RELATED,ESTABLISHED
2516 129K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2710
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:22
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:25
1470 76097 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:80
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:21
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:443
379 22572 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
reject-with icmp-host-prohibited
Is it really well ?
|
|
|
|
08-26-2009, 09:09 AM
|
#25
|
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by a4kata
I turn on the firewall it seems well :
Code:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
33033 4588K RH-Firewall-1-INPUT all -- * * 0.0.0.0/0 0.
0.0.0/0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 RH-Firewall-1-INPUT all -- * * 0.0.0.0/0 0.
0.0.0/0
Chain OUTPUT (policy ACCEPT 37326 packets, 26M bytes)
pkts bytes target prot opt in out source destination
Chain RH-Firewall-1-INPUT (2 references)
pkts bytes target prot opt in out source destination
79 5442 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
icmp type 255
0 0 ACCEPT esp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT ah -- * * 0.0.0.0/0 0.0.0.0/0
321 29981 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251
udp dpt:5353
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0
udp dpt:631
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
tcp dpt:631
28268 4325K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
state RELATED,ESTABLISHED
2516 129K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:2710
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:22
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:25
1470 76097 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:80
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:21
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0
state NEW tcp dpt:443
379 22572 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
reject-with icmp-host-prohibited
Is it really well ?
|
excellent.
it is looking good.
|
|
|
|
08-26-2009, 09:13 AM
|
#26
|
|
Member
Registered: Aug 2009
Posts: 30
Original Poster
Rep:
|
Okay, Thanks for help mates the topic can be closed 
|
|
|
|
08-26-2009, 09:32 AM
|
#27
|
|
Member
Registered: Aug 2009
Posts: 306
Rep:
|
Quote:
Originally Posted by centosboy
you are in danger of your iptables rules becoming a real mess.
have you actually saved any of these rules??
if not, i suggest restarting iptables so it removes these newly added rules, then readding the rule you need, then issuing an
If you have saved the rules, edit /etc/sysconfig/iptables and remove the lines of rules you dont need (port 2700) then restart the iptables firewall
|
Just wondering how would blocking 2700 make iptables a real mess. I'm pretty new to iptable,let me know if there was anything wrong in writing that above rule 
|
|
|
|
08-26-2009, 06:39 PM
|
#28
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 14,963
|
Its good to be parsimonious with iptables rules. IOW, KISS (Keep It Simple Stupid).
First, if you don't have a server program bound/attached to a specific port eg 2700, then there's no point in having rules relating specifically to that port.
Unfortunately, 'port' is a bad name for this, it implies things can get in if it 'open'. In actual fact, if there's no server listening on that 'port' , then there's no sw to connect to from the outside, so it effectively doesn't exist.
Also, during the above conversation, it maybe wasn't made clear that the unwanted rules eg 2700 should be replaced, not added to, eg blah 2700 accept, followed by blah 2700 drop makes no sense.
In fact, you only need to 'open' the port eg 2710 if the default Policy for that chain is Drop. If it (default Policy) is accept, then no accept rule is required.
|
|
|
|
| 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 12:12 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
|
|