unblock certain ports on a linux server

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

unblock certain ports on a linux server

Postby lee » Mon Dec 25, 2006 12:25 pm

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.

Postby thecooldude » Wed Feb 14, 2007 4:59 am

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:

Postby LinuxFreaK » Wed Feb 14, 2007 12:49 pm

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


Return to “General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest