NAKAMURA Minoru の日記 (2025年1月)

先月の日記(2024年12月) 今月の日記(2025年01月)
2002 | 10 | 11 | 12
2003 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2004 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2005 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2006 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2007 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2008 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2009 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2010 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2011 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2012 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2013 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2014 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2015 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2016 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2017 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2018 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2019 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2020 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2021 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2022 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2023 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2024 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2025 | 1 | 2
ホームページ | 最新のコメント50
インデックス: 食べ歩き | Java | プログラム | UNIX | 画像
最新の日記へのリンク | この日記ページをはてなアンテナに追加 この日記ページをはてなブックマークに追加
はてな ダイアリー アンテナ ブックマーク ブログ
Twitter | mixi | Facebook | slideshare | github | Qiita



1/18 (土)

定期の眼科検診く

年に1回の眼底検査をうけるため、武蔵小杉のグランツリー内のひらと眼科に行く。 ここはグランツリー内にあるため10時の開店まで待たされる。


1/16 (木)

[Linux] firewall-cmd --direct がエラー

Linux で firewalld を使う場合、firewall-cmd コマンドを使ってゾーン(zone)を単位としたアクセス制御ルールを行うが、それよりも細かい制御を行いたい場合には firewall-cmd --direct を使うことで firewalld のバックエンドとなっている iptables を制御することができる。

Docker システムに複数の bridge ネットワークを作成した場合、bridge ネットワーク1と bridge ネットワーク2の間にあるコンテナ間では通信ができない。 これを許可するための細かなアクセス制御は firewalld レベルではできず、iptables での制御が必要となる。

そこで firewall-cmd ---direct を使って iptables に対するルールを追加するのだが、

/usr/bin/firewall-cmd --direct --add-rule ipv4 filter DOCKER-USER 0 -p tcp ! -i br-9b6523115ab2 -o br-9b6523115ab2 -s 172.18.0.0/16 -d 172.19.0.5 --dport 8443 -j DROP

を実行したら Error: COMMAND_FAILED: '/usr/sbin/iptables-restore -w -n' failed: iptables-restore: line 3 failed というエラーが出てしまう。

追記: 1/26(木)

上記のエラーを解決するには、firewalld の IndividualCalls という設定を変えればよいと分かる。

/etc/firewalld/firewalld.conf:
# IndividualCalls
# Do not use combined -restore calls, but individual calls. This increases the
# time that is needed to apply changes and to start the daemon, but is good for
# debugging.
# Default: no
# この行をコメントアウト
# IndividualCalls=no
# この行を追加
IndividualCalls=yes

ただし表示は変わったが、という Error: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -I DOCKER-USER 1 -p tcp ! -i br-9b6523115ab2 -o br-9b6523115ab2 -s 172.18.0.0/16 -d 172.19.0.5 --dport 8443 -j DROP' failed: iptables: No chain/target/match by that name. という別のエラーが出てしまう。

追記: 1/27(金)

解決した。

原因はシステムを動かしている Rocky Linux 8 が、firewalld のバックエンドとして iptables ではなく nftables を使うように切り替えていたのが原因のようだ。 /etc/firewalld/firewalld.conf の FirewallBackend を変更して iptables を使うようになると、firewall-cmd ---direct は無事成功した。

/etc/firewalld/firewalld.conf:
# FirewallBackend
# Selects the firewall backend implementation.
# Choices are:
#       - nftables (default)
#       - iptables (iptables, ip6tables, ebtables and ipset)
# この行をコメントアウト
# FirewallBackend=nftables
# この行を追加
FirewallBackend=iptables

Rocky Linux 8 の初期設定でも firewall-cmd ---direct が成功したことがあったはず。 どこかで挙動が変わったのか…


1/2 (水)

風邪を引く

発熱と咳が出て身動きとれなくなる。

追記: 1/6

病院に行ったがインフルエンザA型だった。


1/1 (火)

謹賀新年

明けましておめでとうございます。 今年もよろしくおねがいします。


先月の日記(2024年12月) 今月の日記(2025年01月)
2002 | 10 | 11 | 12
2003 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2004 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2005 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2006 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2007 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2008 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2009 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2010 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2011 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2012 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2013 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2014 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2015 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2016 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2017 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2018 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2019 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2020 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2021 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2022 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2023 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2024 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
2025 | 1 | 2
ホームページ | 最新のコメント50
インデックス: 食べ歩き | Java | プログラム | UNIX | 画像
最新の日記へのリンク | この日記ページをはてなアンテナに追加 この日記ページをはてなブックマークに追加
はてな ダイアリー アンテナ ブックマーク ブログ
Twitter | mixi | Facebook | slideshare | github | Qiita


Written by NAKAMURA Minoru, Email: nminoru atmark nminoru dot jp, Twitter:@nminoru_jp