Open FW from Internet [solved]

Got problems with your B2 or B3? Share and get helped!
Post Reply
eramoli
Posts: 67
Joined: 15 Oct 2010, 13:06
Location: Sundbyberg, Sweden

Open FW from Internet [solved]

Post by eramoli » 05 Dec 2012, 15:16

Hi,

I am currently off-site and discovered that I missed open a port on my B3 before leaving from home. Normally I modify the FW using the Web GUI on the B3 but this I can not access from outside.

I have ssh access to my B3.

How do I simplest open a port on the B3 from the command line? Can I modify the file that is controlled by the Web GUI or should I just modify some other file directly?

Best Regards,
Morgan
Last edited by eramoli on 05 Dec 2012, 18:27, edited 1 time in total.

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Open FW from Internet

Post by Gordon » 05 Dec 2012, 17:30

This should do it:

Code: Select all

iptables -A INPUT -p tcp -i eth0 --dport nnn -j ACCEPT
Substitute nnn for your port number.

eramoli
Posts: 67
Joined: 15 Oct 2010, 13:06
Location: Sundbyberg, Sweden

Re: Open FW from Internet

Post by eramoli » 05 Dec 2012, 18:26

Hi,

Thanks Gordon, you saved my day!

/Morgan

nobody
Posts: 226
Joined: 10 Mar 2012, 14:46

Re: Open FW from Internet [solved]

Post by nobody » 06 Dec 2012, 03:00

Just out of curiosity, wouldnt the -A just append a line after the REJECT and thus be ineffective? Well apparently it works, i just dont understand how

Thanks

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Open FW from Internet [solved]

Post by Gordon » 06 Dec 2012, 03:09

nobody wrote:Just out of curiosity, wouldnt the -A just append a line after the REJECT and thus be ineffective? Well apparently it works, i just dont understand how

Thanks
If you have a REJECT line somewhere in there that matches every packet, then yes appending the rule will have no effect. The default firewall does not have such a rule though. The REJECT/DROP is set as the chain policy and is executed on packets that do not match any of the defined rules.

Post Reply