コンテンツにスキップ

CentOS

systemd

$ systemd-cat -t "example" uname -a
$ journalctl -t "example"
-- Logs begin at Fri 2019-02-15 02:34:41 UTC, end at Tue 2019-03-12 04:33:34 UTC. --
Mar 12 04:33:34 centos example[18688]: Linux centos 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

nmcli

bond設定例

nmcli c show
nmcli c add type bond ifname bond1 con-name bond-bond1 mode 4
nmcli c mod bond-bond1 ipv4.method disabled ipv6.method ignore
nmcli c mod bond-bond1 +bond.options miimon=100
nmcli c mod bond-bond1 +bond.options mode=4
nmcli c mod bond-bond1 +bond.options lacp_rate=1
nmcli c mod bond-bond1 +bond.options xmit_hash_policy=1
nmcli c mod p1p1 +connection.autoconnect yes
nmcli c mod p1p1 +connection.slave-type bond +connection.master bond1
nmcli c mod p1p2 +connection.autoconnect yes
nmcli c mod p1p2 +connection.slave-type bond +connection.master bond1
nmcli c up bond-bond1
nmcli c up p1p1
nmcli c up p1p2
nmcli c add type vlan ifname vlan103 con-name vlan-vlan103 dev bond1 id 103
nmcli c mod vlan-vlan103 ipv4.method manual ipv4.address 172.16.3.11/24 ipv4.route-metric 0 ipv4.never-default yes
nmcli c up vlan-vlan103
nmcli c show

/etc/sysconfig/network-scripts

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Bond
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
NAME="System bond0"
BONDING_OPTS="miimon=100 mode=4 lacp_rate=1 xmit_hash_policy=1"
# cat /etc/sysconfig/network-scripts/ifcfg-bond0.100 
DEVICE=bond0.100
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=172.18.0.11
PREFIX=24
GATEWAY=172.18.0.254
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System bond0"
VLAN=yes
DNS1=8.8.8.8
# cat /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
NAME="System em1"
MASTER=bond0
HWADDR=24:6e:96:71:8f:00
# cat /etc/sysconfig/network-scripts/ifcfg-em2
DEVICE=em2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
NAME="System em2"
MASTER=bond0
HWADDR=24:6e:96:71:8f:01

パッケージ管理

CentOS 8以降 yumdnf のaliasなので、CentOS 7以前の場合は yum で読み替え。

$ sudo dnf update -y

最終更新日: 2021-05-16 15:07:09