2019年4月4日 星期四

OSKLab04-01_Managing Network Interfaces

本章節
實作一些很基本的Linux Network 設定
#lab manage-interfaces setup




























1. 使用 cloud-dev 登入 CLI 連入Console
2. 查看 eth1 的 IP 資訊
3. 設定 eth1 的 IP(寫入參數)
4. 設定 eth2 的 IP(寫入config file)
5. 清除 LAB 環境




1. 使用 cloud-dev 登入 CLI 連入Console
讀取 cloud-dev 的 keystone source 環境變數檔 
#source ~/keystonerc_cloud-dev

查看一下 這個 instance 的 console URL
#openstack console url show network-instance







將這個URL複製起來
貼到瀏覽器上
並使用 root / redhat 進行登入



2. 查看 eth1 的 IP 資訊
#ip a
這時候的 eth1 介面沒有 IP
















3. 設定 eth1 的 IP(寫入參數)
設定有2個方式
一個是只是單純帶入IP
但 instacne 重啟後, eth1 的 I P就會消失
#ip a add 10.1.0.2/24 dev eth1
#ip a show dev eth1










ping 看看  GW 10.1.0.254



4. 設定 eth2 的 IP(寫入config file)
第2種方式
就是直接修改這個介面的 config 檔
先從 eth0 複製一份 config file 到 eth2
再修改 eth2 的 config file
#cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth2
#vi /etc/sysconfig/network-scripts/ifcfg-eth2




修改內容
DEVICE=eth2
IPADDR=10.2.0.2
NETMASK=255.255.255.0
BOOTPROTO=static












再來 ping 一下 這個網段的 GW
應該會 ping fail 
#ping -I eth2 10.2.0.254








這時
我們需要重啟一下 network 的 service 
#systemctl restart network.service
#ip a show dev eth2









再 ping 看看 GW
# ping -I eth2 10.2.2.254







5. 清除 LAB 環境
#lab mange-interfaces cleanup



沒有留言:

張貼留言