01 网络虚拟化技术进阶
注:本节由于openstack源配置不成功导致视频无法正常进行
配置环境
node1 CentOS release 6.7
eth1: 192.168.1.120 桥接
eth0: 仅主机模式 192.168.28.6/24
node2 CentOS release 6.7
eth0: 仅主机模式 192.168.28.7/24 gw:192.168.28.6 UUID和mac地址均需要删除
增加一块网块(eth1)改为VMnet2
node3 192.168.1.122 CentOS release 6.7
eth0: 仅主机模式 192.168.28.8/24 gw:192.168.28.1
增加一块网块(eth1)改为VMnet2
#node1上添加iptables路由转发
[root@node1 ~]# iptables -t nat -A POSTROUTING -s 192.168.28.0/24 -j SNAT --to-source 192.168.1.120
#node1上开启路由转发功能
[root@node1 ~]# vim /etc/sysctl.conf
修改
net.ipv4.ip_forward = 0
为
net.ipv4.ip_forward = 1
#node2和node3添加默认路由
[root@node2 ~]# route add -net default gw 192.168.28.6
[root@node2 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.28.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
0.0.0.0 192.168.28.6 0.0.0.0 UG 0 0 0 eth0
[root@node3 ~]# route add -net default gw 192.168.28.6
[root@node3 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.28.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
0.0.0.0 192.168.28.6 0.0.0.0 UG 0 0 0 eth0
#openstack源配置不成功 本次实验不成功!
[root@node2 ~]# cd /etc/yum.repos.d/
vim openstack.repo
[openstack]
baseurl=http://rdo.fedorapeople.org/openstack/openstack-grizzly/epel-6
gpgcheck=0
[root@node2 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Repository 'openstack' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.zju.edu.cn
* updates: mirrors.zju.edu.cn
http://rdo.fedorapeople.org/openstack/openstack-grizzly/epel-6/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://rdo.fedorapeople.org/openstack/openstack-grizzly/epel-6/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
repo id repo name status
base CentOS-6 - Base 6,696
extras CentOS-6 - Extras 62
openstack openstack 0
updates CentOS-6 - Updates
[root@node2 yum.repos.d]# scp openstack.repo 192.168.28.8:/etc/yum.repos.d/
yum info openvswitch*
[root@node2 yum.repos.d]# yum install openvswitch
[root@node2 yum.repos.d]# service openswitch start
视频截止(60:00)
02 网络虚拟化技术进阶