Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: [OPGELOST]Lijn tussen voegen in ip6tables.  (gelezen 432 keer)

[OPGELOST]Lijn tussen voegen in ip6tables.
« Gepost op: 2013/07/12, 15:14:25 »
Hoe kan ik een lijn  tussenvoegen (b.v. tussen lijn 4 en5) in ip6tables ?
« Laatst bewerkt op: 2013/07/13, 16:06:08 door henkoegema »
Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.4 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)

Offline Johan van Dijk

  • Administrator
    • johanvandijk
Re: Lijn tussen voegen in ip6tables.
« Reactie #1 Gepost op: 2013/07/12, 21:02:12 »
In plaats van de -A optie (append) gebruik je -I (insert) en het regelnummer.
Dus -I 3 als je hem op de 3e regel wil hebben. De huidige regel 3 wordt dan nr. 4.

Re: Lijn tussen voegen in ip6tables.
« Reactie #2 Gepost op: 2013/07/13, 14:44:52 »
In plaats van de -A optie (append) gebruik je -I (insert) en het regelnummer.
Dus -I 3 als je hem op de 3e regel wil hebben. De huidige regel 3 wordt dan nr. 4.

Mijn tabel ziet er als volgt uit:
    root@asteriskondebian:~# ip6tables -nvL --line-numbers
    Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
    num   pkts bytes target     prot opt in     out     source               destination         
    1        0     0 ACCEPT     all      lo     *       ::/0                 ::/0               
    2      200 21295 ACCEPT     all      *      *       ::/0                 ::/0                ctstate RELATED,ESTABLISHED
    3        0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                tcp dpt:22
    4        8   616 ACCEPT     tcp      *      *       ::/0                 ::/0                tcp dpt:80
    5     2470 2528K ACCEPT     all      *      *       2001:7b8:2ff:469::/64  ::/0               
    6     5942  400K ACCEPT     all      *      *       2001:7b8:2ff:8469::/64  ::/0               
    7    30720 2909K ACCEPT     icmpv6    *      *       ::/0                 ::/0               
    8        0     0 DROP       all      *      *       ::/0                 ::/0               

    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    num   pkts bytes target     prot opt in     out     source               destination         
    1    1807K 1457M ACCEPT     all      *      *       ::/0                 ::/0                ctstate RELATED,ESTABLISHED
    2        0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                tcp dpt:22
    3     3375  250K ACCEPT     tcp      *      *       ::/0                 ::/0                tcp dpt:80
    4     4864  614K ACCEPT     all      *      *       2001:7b8:2ff:8469::/64  ::/0               
    5       25  2600 ACCEPT     icmpv6    *      *       ::/0                 ::/0               
    6      985 60119 DROP       all      *      *       ::/0                 ::/0               

    Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
    num   pkts bytes target     prot opt in     out     source               destination         
    1    42623 8194K ACCEPT     all      *      *       ::/0                 ::/0   
     

Nu wil ik als 3e regel in de chain INPUT:

     
root@asteriskondebian:~# ip6tables -I 3 INPUT -p tcp -m tcp --dport 21 -j ACCEPT
ip6tables v1.4.8: Invalid rule number `INPUT'        <--------- ???
Try `ip6tables -h' or 'ip6tables --help' for more information.
root@asteriskondebian:~#


Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.4 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)

Offline Johan van Dijk

  • Administrator
    • johanvandijk
Re: Lijn tussen voegen in ip6tables.
« Reactie #3 Gepost op: 2013/07/13, 15:42:58 »
Sorry, mijn vorige antwoord klopte niet helemaal.

In plaats van -I en dan het nummer moet het -I chainnaam nummer zijn.
Dus iets als
ip6tables -I INPUT 3 -p tcp -m tcp --dport 21 -j ACCEPT

Re: Lijn tussen voegen in ip6tables.
« Reactie #4 Gepost op: 2013/07/13, 16:05:46 »
Sorry, mijn vorige antwoord klopte niet helemaal.

In plaats van -I en dan het nummer moet het -I chainnaam nummer zijn.
Dus iets als
ip6tables -I INPUT 3 -p tcp -m tcp --dport 21 -j ACCEPT

Dank je Johan.    ^-^
Miscere utile dulci. (Ter leering ende vermaeck)
http://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  22.04.4 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & Jetson Nano (voor AI & ML)