Плохое аргумент в команде iptables Nat

Я пытаюсь сделать правило DNAT в iPtables, если пакет с исходным адресом 192.168.86.212 и адрес назначения 192.168.86.212 Затем измените адрес назначения до 172.217.5.100.

sudo iptables -t nat -A PREROUTING   -s 192.168.86.213/32 -d 192.168.96.212/32 -j DNAT -to-destination 172.217.5.100

Но я получил сообщение об ошибке:

Bad argument `172.217.5.100'
Try `iptables -h' or 'iptables --help' for more information.

Я очень новичок в Ubuntu, любая помощь приветствует!

0
задан 25 March 2021 в 02:57

1 ответ

Из MAN IPTables-Extensions , целевой параметр - это значение - до пункта назначения ( С двумя тиреми), а не -TO-пункт назначения :

   DNAT
       This  target is only valid in the nat table, in the PREROUTING and OUT‐
       PUT chains, and user-defined chains which are only  called  from  those
       chains.  It specifies that the destination address of the packet should
       be modified (and all future packets in this  connection  will  also  be
       mangled),  and rules should cease being examined.  It takes the follow‐
       ing options:

       --to-destination [ipaddr[-ipaddr]][:port[-port]]

Это не очевидно, почему сообщение об ошибке флаги iPaddr , а не сам вариант.

0
ответ дан 2 April 2021 в 05:38

Другие вопросы по тегам:

Похожие вопросы: