LINUX.ORG.RU
решено ФорумAdmin

[не догоняю] iptables-save & iptables -L


0

1

Перешел на Debian c Fedora и не совсем понимаю как тут сохранять правила и как их просмотреть.

Делаю следующее.

root@desktop:~# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
root@desktop:~# iptables -L
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

Типа нету примененых правил? Но правило то работает! Если же сделать так

root@desktop:~# iptables-save
# Generated by iptables-save v1.4.8 on Fri Oct 28 09:38:44 2011
*nat
:PREROUTING ACCEPT [122:18702]
:POSTROUTING ACCEPT [2:140]
:OUTPUT ACCEPT [2:140]
-A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Oct 28 09:38:44 2011
# Generated by iptables-save v1.4.8 on Fri Oct 28 09:38:44 2011
*filter
:INPUT ACCEPT [516:78206]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [291:58722]
COMMIT
# Completed on Fri Oct 28 09:38:44 2011

Значит правило все таки есть! Получается iptables -L для чего то другого?

Хотя в wiki debian написано

See what rules are already configured. Issue this command:

iptables -L

Прошу помощи в осознании сего :)

★★

дело не в том, что ты куда-то перешел

man iptables

-L, --list [chain]
              List  all  rules  in  the  selected  chain.   If no chain is selected, all chains are listed. Like every other iptables command, it applies to the specified table (filter is the
              default), so NAT rules get listed by
               iptables -t nat -n -L
              Please note that it is often used with the -n option, in order to avoid long reverse DNS lookups.  It is legal to specify the -Z  (zero)  option  as  well,  in  which  case  the
              chain(s) will be atomically listed and zeroed.  The exact output is affected by the other arguments given. The exact rules are suppressed until you use
               iptables -L -v
uspen ★★★★★
()

еще скажи, что в федоре было не так же

swelf
()

>iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

iptables -t nat -L

gentoo_root ★★★★★
()

Спасибо всем, разобрался, утренний тупак.

Sora ★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.