Page 1 of 1

unblock certain ports on a linux server

Posted: Mon Dec 25, 2006 12:25 pm
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

Unblock Ports.

Posted: Wed Feb 14, 2007 4:59 am
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

Re:

Posted: Wed Feb 14, 2007 12:49 pm
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.