元ITインフラ系エンジニアの日記

元ITインフラ系エンジニアがITのことや投資のこと、コンサルのこと等を綴ります。

VirtualBoxで遊ぶ_5

今日の進捗

DQRにハマっていて、しばらくぶりに弄った。

server01,mail01,mail02,fw01のfirewalldを設定した。 投入したコマンドは以下の通り。  

・firewalldの状態確認

systemctl status firewalld systemctl start firewalld

・現状のZone割当などの確認

firewall-cmd --get-active-zones

firewall-cmd --get-default-zone

firewall-cmd --get-services

firewall-cmd --list-services --zone=public --permanent

・必要なサービスの追加

firewall-cmd --add-service=smtp --zone=public --permanent

firewall-cmd --add-service=dns --zone=public --permanent

・firewalldの再起動と確認

firewall-cmd --reload

 

・メール送信にいちいちsendコマンドを打つのが面倒なので、catで送れるようにした。  

vi test_mail.txt

From:root@internal.example.com

To:user01@external.example.com

Subject:testmail

 

test mail

 

[esc]

:wq!

cat test_mail.txt | sendmail -i -t

 

次回の予定

外側のmail02からmail01を経由したserver01へのメール配信ができない。 これは次回への課題。

logにはこう出ている。

postfix/smtpd[xxxx]: connect from unknown[192.168.2.104] postfix/smtpd[xxxx]: NOQUEUE: reject: RCPT from unknown[192.168.2.104]: 454 4.7.1 <xxx@internal.example.com>: Relay access denied; from=<root@mail02.external.example.com> to <xxx@internal.example.com> proto=ESMTP helo=<mail02.external.example.com> postfix/smtpd[xxxx]: disconnect from unknown[192.168.2.104]

これをみると、fwは関係無さそう。mail01のpostfixの設定を見直せば上手くいく気がする。