• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

(GELÖST) SuSEfirewall2 (iptables) kann kein regeln speichern

Hallo Leute,

ich habe ein Problem.
Ich möchte gerne 2 Regeln in die iptables hinzufügen, aber immer wenn ich firewall neustarte dann verwindet diesen Regeln wieder.

hier sind die 2 Regeln:
Code:
iptables -A FORWARD -i br0 -o tun1 -j ACCEPT
iptables -A FORWARD -i tun1 -o br0 -j ACCEPT
nach den ich diesen 2 Regeln eingegeben habe zeigt iptables das an:

Code:
Linux-Server:~ # iptables -nvL FORWARD
Chain FORWARD (policy DROP 21 packets, 1374 bytes)
 pkts bytes target     prot opt in     out     source               destination
   80  4084 TCPMSS     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU
 3661 2095K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           PHYSDEV match --physdev-is-bridged
 2851  195K forward_int  all  --  br0    *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_int  all  --  eth0   *       0.0.0.0/0            0.0.0.0/0
 2702 3517K forward_ext  all  --  eth1   *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  tap3_0 *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  tun0   *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  tun1   *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  vif3_0 *       0.0.0.0/0            0.0.0.0/0
    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 3/min burst 5 LOG flags 6 level 4 prefix `SFW2-FWD-ILL-ROUTING '
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  tun1   br0     0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  br0    tun1    0.0.0.0/0            0.0.0.0/0

wenn ich firewall wieder neustarte dann sind die Regeln wieder weg.

Code:
Linux-Server:~ # iptables -nvL FORWARD
Chain FORWARD (policy DROP 11 packets, 2305 bytes)
 pkts bytes target     prot opt in     out     source               destination
   12   576 TCPMSS     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU
  211 54955 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           PHYSDEV match --physdev-is-bridged
  162 15387 forward_int  all  --  br0    *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_int  all  --  eth0   *       0.0.0.0/0            0.0.0.0/0
  163  204K forward_ext  all  --  eth1   *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  tap3_0 *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  tun0   *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  tun1   *       0.0.0.0/0            0.0.0.0/0
    0     0 forward_ext  all  --  vif3_0 *       0.0.0.0/0            0.0.0.0/0
    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 3/min burst 5 LOG flags 6 level 4 prefix `SFW2-FWD-ILL-ROUTING '
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

wie kann ich es ändern, damit es bei starten die 2 Regeln mit übernommen wird.

Danke an euch.

MfG
 

framp

Moderator
Teammitglied
1) Editieren von /etc/sysconfig/SuSEFirewall2.
Code:
#FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom"
# weg und # vor
Code:
FW_CUSTOMRULES=""
schreiben
2) Einfügen Deiner Rules in /etc/sysconfig/scripts/SuSEfirewall2-custom
 
Oben