LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   shell got confused with iptables ... (https://www.linuxquestions.org/questions/linux-security-4/shell-got-confused-with-iptables-288188/)

ilnli 02-09-2005 01:20 PM

shell got confused with iptables ...
 
can any body tell me the solution for this?

Code:

root@DARKSTAR:~# iptables -A OUTPUT -p tcp --dport !1863 -j DROP
-bash: !1863: event not found
root@DARKSTAR:~#


secesh 02-09-2005 01:29 PM

Quote:

mac
--mac-source [!] address
Match source MAC address. It must be of the form
XX:XX:XX:XX:XX:XX. Note that this only makes sense
for packets coming from an Ethernet device and
entering the PREROUTING, FORWARD or INPUT chains.
--destination-ports port[,port[,port...]]
Match if the destination port is one of the given
ports. The flag --dports is a convenient alias for
this option.
can't say i'm an iptables expert, but i notice two things syntactically:
1) i included the mac quote above to illustrate that the manpage specifies a space when using !
2) the --dports option does not specify use of ! as acceptable (two-step the rule? -- allow the one port, drop all others -- is that what you're trying to do?)

ilnli 02-09-2005 01:37 PM

no thats not my problem i am saying that my shell is interpresting ! as its history but i want to block all ports except 1863 how would be that possible, how can I tell me shell not to consider ! as its history command?

ilnli 02-09-2005 01:38 PM

no thats not my problem i am saying that my shell is interpreting ! as its history but i want to block all ports except 1863 how would be that possible, how can I tell me shell not to consider ! as its history command?

ilnli 02-09-2005 01:47 PM

no thats not my problem i am saying that my shell is interpreting ! as its history but i want to block all ports except 1863 how would be that possible, how can I tell me shell not to consider ! as its history command?

Hangdog42 02-09-2005 03:18 PM

Code:

iptables -P OUTPUT DROP
iptables -A OUTPUT -p tcp --dport 1863 -j ACCEPT


XavierP 02-09-2005 03:32 PM

Moved: This thread is more suitable in Linux-Security and has been moved accordingly to help your thread/question get the exposure it deserves.

ilnli 02-12-2005 07:02 AM

anyone with some other suggestions


All times are GMT -5. The time now is 06:31 AM.