Armadilloフォーラム

iptablesの永続化について

y.shimizu

2025年3月18日 15時13分

==========
製品型番:
Debian/ABOSバージョン:Linux armadillo 5.10.233-0-at #1-Alpine Mon Jan 27 06:31:25 UTC 2025 armv7l Linux
カーネルバージョン:3.20.5-at.8
3G/LTE モジュール情報 (Debianのみ):
その他:
==========

いつもお世話になっております。

特定のポートのみ解放させたく、iptablesで設定を行いました。
再起動を行うと、設定が保存されておりませんでした。
iptables-persistentのインストールを行うために、apk addを行いましたが、パッケージにないとエラーが起きました。
iptablesの永続化についてご教示ください。

#iptablesの保存
[armadillo ~]# iptables-save > /etc/iptables/rules.v4
[armadillo ~]#persist_file /etc/iptables/rules.v4
 
#aptでの保存
[armadillo:~]# apt-get update && apt-get install iptables-persistent
-sh: apt-get: not found
 
#apkでの保存
[armadillo:~]# apk update && apk add iptables-persistent
fetch https://download.atmark-techno.com/alpine/v3.20/atmark/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/armv7/APKINDEX.tar.gz
atmark [https://download.atmark-techno.com/alpine/v3.20/atmark]
v3.20.6-59-g890a83623e3 [https://dl-cdn.alpinelinux.org/alpine/v3.20/main]
v3.20.6-60-g689f1fd490d [https://dl-cdn.alpinelinux.org/alpine/v3.20/community]
OK: 22807 distinct packages available
ERROR: unable to select packages:
  iptables-persistent (no such package):
    required by: world[iptables-persistent]

◆参考にしたページ
 https://manual.atmark-techno.com/armadillo-guide-std/armadillo-guide-st…
 https://manual.atmark-techno.com/armadillo-iot-a6/armadillo-iota6_produ…

コメント

at_shota.shimoyama

2025年3月18日 16時49分

アットマークテクノの下山です。

ABOSでのiptablesの永続化方法については、A6Eのマニュアル内の以下の項目に記載がございます。
https://armadillo.atmark-techno.com/files/downloads/armadillo-iot-a6e/d…

かいつまみますと、iptablesで設定を行ったうえで、次のコマンドを実行すると/etc/iptables/rules-saveにその設定内容が保存されます。(再起動を行っても保存されたままです)

[armadillo ~]# /etc/init.d/iptables save
[armadillo ~]# persist_file /etc/iptables/rules-save

よろしくおねがいします。

アットマークテクノ
下山様

ありがとうございます。
上記手順で永続化されました。

at_shota.shimoyama

2025年3月18日 17時49分

y.shimizu 様

すみません、1点補足させてください。

マニュアルへの記載が不足している内容なのですが、ABOSはデフォルトの状態だとiptablesサービスが無効になっています。
そのため、iptablesサービスを使用するためには、以下のコマンドでサービスの有効化&永続化を行ってください。(ABOS Webで設定を行った後だと、既に有効になっている場合があります。)

[armadillo ~]# rc-update add iptables
[armadillo ~]# persist_file /etc/runlevels/default/iptables