1. NAT網絡配置(全部服務器):
# yum install bash-completionhtml
# cd /etc/sysconfig/network-scripts/vim
bond0配置:centos
# vim ifcfg-bond0bash
BOOTPROTO=static服務器
NAME=bond0網絡
DEVICE=bond0oop
ONBOOT=yes阿里雲
BONDING_MASTER=yesspa
BONDING_OPTS="mode=1 miimon=100" #指定綁定類型爲1及鏈路狀態監測間隔時間code
IPADDR=192.168.10.21
NETMASK=255.255.255.0
GATEWAY=192.168.10.2
DNS1=202.106.0.20
eth0配置:
# cat ifcfg-eth0
BOOTPROTO=static
NAME=eth0
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
USERCTL=no
SLAVE=yes
ech1配置
# vim ifcfg-eth1
BOOTPROTO=static
NAME=eth1
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
USERCTL=no
SLAVE=yes
2.僅主機網絡配置
# cd /etc/sysconfig/network-scripts/
Bond1配置:
# vim ifcfg-bond1
BOOTPROTO=static
NAME=bond1
DEVICE=bond1
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100" #指定綁定類型爲1及鏈路狀態監測間隔時間
IPADDR=192.168.20.21
NETMASK=255.255.255.0
eth2配置:
# vim ifcfg-eth2
BOOTPROTO=static
NAME=eth2
DEVICE=eth2
ONBOOT=yes
MASTER=bond1
USERCTL=no
SLAVE=yes
eth3配置:
# vim ifcfg-eth3
BOOTPROTO=static
NAME=eth3
DEVICE=eth3
ONBOOT=yes
MASTER=bond1
USERCTL=no
SLAVE=yes
3.查看網卡狀態:
# nmcli c reload
# nmcli c up ethX
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
link/ether 00:0c:29:9d:a6:a6 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
link/ether 00:0c:29:9d:a6:a6 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond1 state UP group default qlen 1000
link/ether 00:0c:29:9d:a6:ba brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond1 state UP group default qlen 1000
link/ether 00:0c:29:9d:a6:ba brd ff:ff:ff:ff:ff:ff
6: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:9d:a6:ba brd ff:ff:ff:ff:ff:ff
inet 192.168.20.50/24 brd 192.168.20.255 scope global noprefixroute bond1
valid_lft forever preferred_lft forever
7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:9d:a6:a6 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.50/24 brd 192.168.10.255 scope global noprefixroute bond0
valid_lft forever preferred_lft forever
4.內外網通訊:
# ping www.baidu.com
# ping 192.168.20.2
6.更新yum雲:
# yum install wget –y
# rm -rf /etc/yum.repos.d/*
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# yum install –y centos-release-openstack-ocata.noarch
# yum install -y https://rdoproject.org/repos/rdo-release.rpm
# yum clean all
# yum makecache
主:更新阿里雲openstack-ocata源,需更改rdo.repo, openstack-ocata.repo中的源爲:
http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-ocata/
http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-queens/
7.查看yum源版本:
yum list centos-release-openstack*
8.安裝經常使用命令
# yum install -y net-tools vim lrzsz tree screen lsof ntpdate telnet wget
原文出處:https://www.cnblogs.com/wangshuyang/p/12242823.html