Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to create a minecraft server for me and my friends to connect to (port 25565). I already use ddclient, which updates the external ip so that the data sent to the hostname is forwarded to the external IP.

I want to remove iptables because it is not going to help with anything suited for what I am trying to do. Although, if I remove it is there any other way I can forward the traffic through my external IP? - Or would it forward by default? And may I add, I would not like to just set the default rule to ACCEPT all connections because this doesn't solve my issue.

I also know that if I keep Iptables, I will have to set up/modify an init script to update the rules every x minutes for the setup to work which will take even longer? But then I also realise that there for a reason - a firewall: To protect against hackers. Though, my ISP (Sky) does have a firewall that is default to BLOCK all connections, unless the port has been specified; in which I have forwarded the ports that are necessary for my server to run.

Would this be safe enough to run my server behind? And can I remove Iptables?

Thank you!

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

It would be saver if you keep iptables and setup the right rules to open the Minecraft ports. I would proceed as follows:

nano /etc/iptables.rules

insert

# 1. Delete all existing rules
iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# 2. Accept established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# 3. Allow all outgoing traffic
-A OUTPUT -j ACCEPT
# 4. Allow Minecraft - default ports
-A INPUT -p tcp --dport 25565 -j ACCEPT
# 5. Reject everything else
-A INPUT -j REJECT
-A FORWARD -j REJECT

restart firewall with new rules

iptables-restore < /etc/iptables.rules

load each time the server starts

iptables-save > /etc/iptables.rules
share|improve this answer
add comment

Iptable is a part from the kernel and cannot be removed , in Ubuntu firewall is disabled by default and allow all traffics to flow .

To disable firewall :

sudo ufw disable 

This can help you configuring your firewall .

share|improve this answer
1  
"Iptable is a part from the kernel and cannot be removed" Are you sure there's no way? Typically kernel services can be disabled and kernel modules can be unloaded. (This isn't a rhetorical question: while I know netfilter--the part of the kernel that is controlled by iptables and actually provides the firewall functionality--can be completely removed by rebuilding the kernel, I don't know if there's currently an easy way to remove or totally disable it using official Ubuntu kernels with no recompilation.) –  Eliah Kagan Mar 3 at 18:50
    
Why would you need to remove iptables entirely? You can simply disable it and remove it from the start order, which would, for all intents and purposes, do what you want. –  Ross Mar 3 at 18:55
    
@Ross I'm not sure who you're replying to; I don't want to disable iptables at all. I'm just interested by the idea that it actually cannot be removed; I suspect that is not entirely true. –  Eliah Kagan Mar 3 at 19:09
    
do u think it can be removed ? –  nux Mar 3 at 19:10
    
@EliahKagan, sorry, I thought you were the original poster. I agree, I definitely think it can be removed. It will be painful, but I think you could do it. –  Ross Mar 3 at 19:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.