Page 1 of 1

Open FW from Internet [solved]

Posted: 05 Dec 2012, 15:16
by eramoli
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

Re: Open FW from Internet

Posted: 05 Dec 2012, 17:30
by Gordon
This should do it:

Code: Select all

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

Re: Open FW from Internet

Posted: 05 Dec 2012, 18:26
by eramoli
Hi,

Thanks Gordon, you saved my day!

/Morgan

Re: Open FW from Internet [solved]

Posted: 06 Dec 2012, 03:00
by nobody
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

Re: Open FW from Internet [solved]

Posted: 06 Dec 2012, 03:09
by Gordon
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.