LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2010, 08:58 PM   #1
babbab
Member
 
Registered: Mar 2010
Distribution: slackware64 current
Posts: 104

Rep: Reputation: 4
Openning port for battle.net iptables


How do I open port for battle.net with iptables.
I searched the internet and can't find the answer

need to open these

port 4000 TCP,UDP in and out
port 6113-6119 TCP,UDP in and out

anyone?
 
Old 04-02-2010, 12:11 AM   #2
mweed
Member
 
Registered: Mar 2006
Posts: 33

Rep: Reputation: 17
It will depend on how you rules are currently set up. Are you currently filtering outbound traffic?

When you say in and out does that mean that battle.net connects to your host on ports 4000, 6113:6119 or does in and out just mean that reply packets on your session need to get back in? Also do you have a network/ip list for the battle.net servers?

The following will allow inbound and outbound connections on the port ranges listed TO THE WORLD.

iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 4000 -j ACCEPT
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 6113:6119 -j ACCEPT
iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I OUTPUT -p tcp -m state --state NEW -m tcp --dport 4000 -j ACCEPT
iptables -I OUTPUT -p tcp -m state --state NEW -m tcp --dport 6113:6119 -j ACCEPT
iptables -I OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

These rules may or may not make sense depending on your current configs. If when doing iptables -L you see that the current OUTPUT chain is empty then ignore the three OUTPUT commands above. If your firewall rules already have an accept rule for related and established then ignore the related/established rule above and add an index after INPUT that is below the existing related/established rule.

But honestly you may be best off using the firewall config utility shipped with your distribution. It will add rules in the proper chains in the proper fashion as the other rules.
 
Old 04-02-2010, 08:49 AM   #3
babbab
Member
 
Registered: Mar 2010
Distribution: slackware64 current
Posts: 104

Original Poster
Rep: Reputation: 4
First my mistake said earlier that open ports needed are 4000 and 6113:6119
correct open ports are 4000 6112:6119

>>It will depend on how you rules are currently set up. Are you currently >>filtering outbound traffic?

here's my current setting
I opened port 59527 read from tutorial on the web.

# Generated by iptables-save v1.4.0 on Fri Apr 2 09:31:11 2010
*nat
:PREROUTING ACCEPT [392:56543]
:POSTROUTING ACCEPT [4:244]
:OUTPUT ACCEPT [4:244]
-A PREROUTING -p tcp -m tcp --dport 59527 -j DNAT --to-destination 10.1.1.52
-A POSTROUTING -s 10.1.1.0/24 -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Apr 2 09:31:11 2010
# Generated by iptables-save v1.4.0 on Fri Apr 2 09:31:11 2010
*filter
:INPUT ACCEPT [971:234521]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [408:58162]
-A FORWARD -s 10.1.1.0/24 -o eth0 -j ACCEPT
-A FORWARD -d 10.1.1.0/24 -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

-A FORWARD -s 10.1.1.52/32 -p tcp -m tcp --dport 59527 -j ACCEPT
COMMIT
# Completed on Fri Apr 2 09:31:11 2010

and also result from iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 10.1.1.0/24 anywhere
ACCEPT all -- anywhere 10.1.1.0/24 state RELATED,ESTAB
LISHED
ACCEPT tcp -- 10.1.1.52 anywhere tcp dpt:59527

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

>>When you say in and out does that mean that battle.net connects to your host >>on ports 4000, 6113:6119 or does in and out just mean that reply packets on >>your session need to get back in? Also do you have a network/ip list for the >>battle.net servers?
I think other players need to connect to my host on ports 4000, 6112:6119 through linux box
I searched ip list for battle.net didn't yield result.
 
Old 04-02-2010, 10:01 AM   #4
babbab
Member
 
Registered: Mar 2010
Distribution: slackware64 current
Posts: 104

Original Poster
Rep: Reputation: 4
ok these commands open the ports on linux box but problem is now I can't connect to battle.net server

is something wrong with these commands to open the port and play game at battle.net?
How come this works with bittorrent but not with battle.net server?

iptables -t nat -A PREROUTING -p tcp --dport 4000 -j DNAT --to-destination 10.1.1.52
iptables -t nat -A PREROUTING -p udp --dport 4000 -j DNAT --to-destination 10.1.1.52
iptables -A FORWARD -s 10.1.1.52 -p tcp --dport 4000 -j ACCEPT
iptables -A FORWARD -s 10.1.1.52 -p udp --dport 4000 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 6112:6119 -j DNAT --to-destination 10.1.1.52
iptables -t nat -A PREROUTING -p udp --dport 6112:6119 -j DNAT --to-destination 10.1.1.52
iptables -A FORWARD -s 10.1.1.52 -p tcp --dport 6112:6119 -j ACCEPT
iptables -A FORWARD -s 10.1.1.52 -p udp --dport 6112:6119 -j ACCEPT

btw set up is

internet -- linuxbox ( which i'm configuring ) -- access point -- my laptop

Last edited by babbab; 04-02-2010 at 10:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Port openning on external interface satish Linux - Networking 5 06-26-2006 07:20 AM
Openning a port...doesn't work?! vous Linux - Networking 10 04-09-2005 11:29 PM
Openning Port need Help jadid Linux - Networking 4 11-30-2004 11:42 PM
iptables port forwarding removes net access? Avatar Linux - Networking 2 05-21-2004 12:56 PM
openning port 22 for ssh krzykard Linux - Security 4 10-22-2003 09:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration