You are not logged in.

#1 2013-02-07 14:16:12

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 216

[SOLVED]Closing tcp ports

Hello,

I would to close some TCP ports, namely 139 and 445.  I have read something about that, and then I tried with this command:

sudo iptables -t filter -A INPUT -p tcp --syn --dport 139 -i ppp0 REJECT
Bad argument `REJECT'
Try `iptables -h' or 'iptables --help' for more information.

Can someone tell me how to close those ports? Many thanks.

Regards.

Last edited by Grant (2013-02-10 11:08:39)


I am not a native speaker. If you see a mistake, please report it to me via private message. Thank you.

Offline

#2 2013-02-07 15:41:34

aesiris
Member
Registered: 2012-02-25
Posts: 94

Re: [SOLVED]Closing tcp ports

Wrong syntax: you're missing a -j before REJECT

To learn how to use iptables with Arch search on the wiki
for example https://wiki.archlinux.org/index.php/Iptables

Offline

#3 2013-02-07 15:41:36

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: [SOLVED]Closing tcp ports

try with -j DROP

something like this:

iptables -t filter -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -i ppp0  -j DROP

Maybe you'll need to adjust the syntax.

Last edited by chris_l (2013-02-07 15:41:54)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#4 2013-02-08 19:29:05

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 216

Re: [SOLVED]Closing tcp ports

1)It doesn't work.
2)I tried to add iptables at the boot using systemctl, but it gives [ failed ]. It isn't started with

#systemctl start iptables

.
Or maybe is just active? How I can read its log?
Regards.


I am not a native speaker. If you see a mistake, please report it to me via private message. Thank you.

Offline

Board footer

Powered by FluxBB