New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

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 »

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: 1461
Joined: 10 Aug 2011, 03:18

Re: Open FW from Internet

Post 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.
eramoli
Posts: 67
Joined: 15 Oct 2010, 13:06
Location: Sundbyberg, Sweden

Re: Open FW from Internet

Post by eramoli »

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 »

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: 1461
Joined: 10 Aug 2011, 03:18

Re: Open FW from Internet [solved]

Post 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.
Post Reply