unblock certain ports on a linux server

General discussion about PLUC and Linux in Pakistan.

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
lee
Cadet
 
Posts: 12
Joined: Sat Jun 17, 2006 2:57 pm
WLM: Great_libra28@hotmail.com
Yahoo Messenger: great_libra28@yahoo.com
Location: karachi

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
thecooldude
Lance Naik
 
Posts: 43
Joined: Sun Nov 26, 2006 6:04 pm
Website: http://www.xsroot.com
WLM: cancerian_pisces@hotmail.com
Location: Dubai, UAE.

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi


Return to “%s” General

Who is online

Users browsing this forum: No registered users and 1 guest

cron