unblock certain ports on a linux server

General discussion about PLUC and Linux in Pakistan.
Post Reply
lee
Cadet
Posts: 12
Joined: Sat Jun 17, 2006 2:57 pm
Location: karachi
Contact:

unblock certain ports on a linux server

Post by lee »

hi guys,

I need to unblock certain ports on a linux server, how do i go about doing that? i need to unblock them becoz i wanna play counter strike and trackmania online, but it wont let me connect. {and also BearShare}
Could someone please tell me how to get around this or unblock them, is there a program that can do it or what? :cry:

cs ports
NET Ports: server 27015, client 2700

Thanks
Linux for human beings
thecooldude
Lance Naik
Posts: 43
Joined: Sun Nov 26, 2006 6:04 pm
Location: Dubai, UAE.
Contact:

Unblock Ports.

Post by thecooldude »

iptables -A FORWARD -p tcp --dport ANY-PORT -j ACCEPT

Example:

iptables -A FORWARD -p tcp --dport 31337 -j ACCEPT

Same for UDP, just replace tcp with UDP

Example:

iptables -A FORWARD -p udp --dport 31337 -j ACCEPT

Now,

Service iptables save

Service iptables restart

look into vi /etc/sysconfig/iptables

Enjoy!

Cheers.

Thanks

..

Regards,

Khurram Nawaz.
0300-4141791
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear lee,
Salam,
lee wrote:I need to unblock certain ports on a linux server, how do i go about doing that? i need to unblock them becoz i wanna play counter strike and trackmania online, but it wont let me connect. {and also BearShare}
Could someone please tell me how to get around this or unblock them, is there a program that can do it or what? :cry:
cs ports NET Ports: server 27015, client 2700
# iptables -A INPUT -p tcp --dport 27015 -j ACCEPT
# iptables -A INPUT -p tcp --dport 2700 -j ACCEPT


If your clients are behind NAT then you should use below rules.

# iptables -t nat -A PREROUTING -p tcp --dport 27015 -j ACCEPT
# iptables -t nat -A PREROUTING -p tcp --dport 2700 -j ACCEPT


You should read documents regarding iptables.

FYI, http://www.netfilter.org

Best Regards.
Farrukh Ahmed
Post Reply