Linux」カテゴリーアーカイブ

postfixでso-netのメールサーバ経由で送信

CentOS7,8で確認
yum install -y postfix cyrus-sasl cyrus-sasl-plain mailx

Debian系
apt install -y postfix libsasl2-2 libsasl2-modules bsd-mailx

# /etc/postfix/main.cf に以下を追記
relayhost = [mail.so-net.ne.jp]:587
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/so-net_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
# /etc/postfix/so-net_passwd を作成し、下記内容を記載
[mail.so-net.ne.jp]:587 ユーザID:パスワード
postmap hash:/etc/postfix/so-net_passwd

必要に応じて/etc/alias編集
newaliasesコマンド実行

systemctl enable postfix;\
systemctl restart postfix

nmcliでbridgeとbondingとvlanを組み合わせる

nmtuiではできないっぽいのでnmcliでやる

bridgeとbondingの組み合わせ

まずbridgeを作る

nmcli c add type bridge ifname br0 con-name br0
nmcli c mod br0 bridge.stp no
nmcli c mod br0 ipv4.method manual ipv4.address "192.168.1.100/24" ipv4.gateway "192.168.1.1" ipv4.dns "8.8.8.8 8.8.4.4" ipv4.dns-search lan
nmcli c down br0
nmcli c up br0

bridgeにbondingを追加

nmcli c add type bond ifname bond0 con-name bond0 mode active-backup
nmcli c mod bond0 connection.master br0 connection.slave-type bridge
nmcli c add type bond-slave ifname enpxxx con-name bond-slave-enpxxx master bond0
nmcli c add type bond-slave ifname enpyyy con-name bond-slave-enpyyy master bond0
nmcli c down bond-slave-enpxxx
nmcli c down bond-slave-enpyyy
nmcli c down bond0
nmcli c up bond-slave-enpxxx
nmcli c up bond-slave-enpyyy
nmcli c up bond0

bridgeとbondingの組み合わせで更にVLANも指定する

まず上のbridgeとbonding組み合わせを作る

VLAN ID2の場合

nmcli c add type bridge ifname br0.2 con-name br0.2;\
nmcli c mod br0.2 bridge.stp no;\
nmcli c mod br0.2 ipv4.method disable;\
nmcli c mod br0.2 ipv6.method disable;\
nmcli c down br0.2;\
nmcli c up br0.2;\
nmcli c add type vlan ifname bond0.2 con-name bond0.2 dev bond0 id 2;\
nmcli c mod bond0.2 connection.master br0.2 connection.slave-type bridge;\
nmcli c down bond0.2;\
nmcli c up bond0.2;

VLAN ID3の場合

nmcli c add type bridge ifname br0.3 con-name br0.3;\
nmcli c mod br0.3 bridge.stp no;\
nmcli c mod br0.3 ipv4.method disable;\
nmcli c mod br0.3 ipv6.method disable;\
nmcli c down br0.3;\
nmcli c up br0.3;\
nmcli con add type vlan ifname bond0.3 con-name bond0.3 dev bond0 id 3;\
nmcli c mod bond0.3 connection.master br0.3 connection.slave-type bridge;\
nmcli c down bond0.3;\
nmcli c up bond0.3;