A
A
Alexander Koshelev2018-07-19 22:55:55
iptables
Alexander Koshelev, 2018-07-19 22:55:55

Why does it give an error when setting rules for iptables?

Good evening, I googled the error and in many vorums they write that the matter is in the type of virtualization, it does not work in openVZ, but I do not have this type.

iptables -t nat -A OUTPUT ! -o lo -p tcp -m owner --uid-owner user -m tcp -j REDIRECT --to-ports 9040;

when adding a rule, it gives such an error,
iptables: No chain/target/match by that name.
but the output is like this(
[email protected]:~$ sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            owner UID match 1001 tcp dpt:9040
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            owner UID match 1001 udp dpt:53
DROP       all  --  0.0.0.0/0            0.0.0.0/0            owner UID match 1001
[email protected]:~$

help me please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2018-07-19
@Xandr24

well, in the same place in black and white, it says there is no chain / target / coincidence by name. We look below and do not observe ...

M
mureevms, 2018-07-20
@mureevms

What is the REDIRECT action . In general, the rule should work if you insert a real system user, instead of the user used for the example

iptables -t nat -A OUTPUT ! -o lo -p tcp -m owner --uid-owner root -m tcp -j REDIRECT --to-ports 9040

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question