溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

openstack中母機(jī)重啟后網(wǎng)橋設(shè)置

發(fā)布時(shí)間:2020-07-21 01:34:47 來(lái)源:網(wǎng)絡(luò) 閱讀:426 作者:我必封天 欄目:云計(jì)算

# 需求:遷移環(huán)境母機(jī)在重啟后,需要手動(dòng)配置網(wǎng)橋
重啟后,如下圖示:

[root@host-10-123-98-218 ~]# ifconfig
eth2      Link encap:Ethernet  HWaddr 00:E0:81:E6:6C:3B  
          inet addr:10.123.98.218  Bcast:10.123.98.255  Mask:255.255.255.192
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5374 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4010 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:584689 (570.9 KiB)  TX bytes:575491 (562.0 KiB)
          Memory:f7900000-f7920000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:163 errors:0 dropped:0 overruns:0 frame:0
          TX packets:163 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:167824 (163.8 KiB)  TX bytes:167824 (163.8 KiB)

可以查看更多的網(wǎng)絡(luò)情況

[root@host-10-123-98-218 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    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
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:e0:81:e6:6c:3a brd ff:ff:ff:ff:ff:ff
3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:e0:81:e6:6c:3b brd ff:ff:ff:ff:ff:ff
    inet 10.123.98.218/26 brd 10.123.98.255 scope global eth2
       valid_lft forever preferred_lft forever          

查看當(dāng)前網(wǎng)橋信息

[root@host-10-123-98-218 ~]# brctl show
bridge name     bridge id               STP enabled     interfaces

這里可以對(duì)比同一網(wǎng)絡(luò)區(qū)域其他正常母機(jī)網(wǎng)絡(luò),如下:

[root@host-10-123-98-213 ~]# ifconfig                                       
eth2      Link encap:Ethernet  HWaddr 00:E0:81:E6:6B:BB                             #真實(shí)網(wǎng)卡
          inet addr:10.123.98.213  Bcast:10.123.98.255  Mask:255.255.255.192
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1758313140 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1129411318 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:301531883354 (280.8 GiB)  TX bytes:184138656905 (171.4 GiB)
          Memory:f7900000-f7920000 

eth2.3    Link encap:Ethernet  HWaddr 00:E0:81:E6:6B:BB                             #添加的網(wǎng)橋
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:542897803 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114650555 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:33814358483 (31.4 GiB)  TX bytes:22081251843 (20.5 GiB)

eucabr3   Link encap:Ethernet  HWaddr 00:E0:81:E6:6B:BB                             # #添加的網(wǎng)橋
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:439499091 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:23134270803 (21.5 GiB)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:158403403 errors:0 dropped:0 overruns:0 frame:0
          TX packets:158403403 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:11455266584 (10.6 GiB)  TX bytes:11455266584 (10.6 GiB)

vnet0     Link encap:Ethernet  HWaddr FE:54:00:7E:8B:25                            #虛擬機(jī)網(wǎng)卡
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:256 errors:0 dropped:439498799 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 b)  TX bytes:15360 (15.0 KiB)

vnet1     Link encap:Ethernet  HWaddr FE:0D:EB:DA:A9:43                            #虛擬機(jī)網(wǎng)卡
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:114650555 errors:0 dropped:0 overruns:0 frame:0
          TX packets:542897475 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:22081251843 (20.5 GiB)  TX bytes:41255620926 (38.4 GiB)

1、設(shè)置子網(wǎng)卡 eth2.3 #vconfig add eth2 3
2、創(chuàng)建網(wǎng)橋 #brctl addbr eucabr3
3、將eht1.3端口加入到網(wǎng)橋eucabr3 #brctl addif eucabr3 eth2.3
4、啟動(dòng)子網(wǎng)卡和網(wǎng)橋 ifconfig eth2.3 up;ifconfig eucabe3 up

[root@host-10-123-98-218 ~]# ifconfig
eth2      Link encap:Ethernet  HWaddr 00:E0:81:E6:6C:3B  
          inet addr:10.123.98.218  Bcast:10.123.98.255  Mask:255.255.255.192
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20978 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1682834 (1.6 MiB)  TX bytes:1258355 (1.2 MiB)
          Memory:f7900000-f7920000 

eth2.3    Link encap:Ethernet  HWaddr 00:E0:81:E6:6C:3B  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8419 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:394168 (384.9 KiB)  TX bytes:0 (0.0 b)

eucabr3   Link encap:Ethernet  HWaddr 00:E0:81:E6:6C:3B  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1505 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:71176 (69.5 KiB)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:221 errors:0 dropped:0 overruns:0 frame:0
          TX packets:221 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:172856 (168.8 KiB)  TX bytes:172856 (168.8 KiB)

查看母機(jī)上虛擬機(jī)狀態(tài),啟動(dòng)處于關(guān)閉狀態(tài)的虛擬機(jī)

[root@host-10-123-98-218 ~]# virsh list
 Id    Name                           State
----------------------------------------------------

[root@host-10-123-98-218 ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     i-C70462A7                     shut off
 -     i-D69199A5                     shut off

[root@host-10-123-98-218 ~]# vitsh start i-C70462A7
Hey! No command 'vitsh' found, did you mean 'virsh'?
[root@host-10-123-98-218 ~]# virsh start i-C70462A7
Domain i-C70462A7 started

[root@host-10-123-98-218 ~]# virsh dominfo i-C70462A7
Id:             12
Name:           i-C70462A7
UUID:           5452a99f-9695-46d8-b7b6-92658d1e85d8
OS Type:        hvm
State:          running
CPU(s):         4
CPU time:       4.9s
Max memory:     3670016 KiB
Used memory:    3670016 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0

[root@host-10-123-98-218 ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 12    i-C70462A7                     running
 -     i-D69199A5                     shut off
 -    

虛擬機(jī)正常啟動(dòng),就表示母機(jī)網(wǎng)橋設(shè)置正常

[root@host-10-123-98-218 ~]# ping 10.123.7.87
PING 10.123.7.87 (10.123.7.87) 56(84) bytes of data.
64 bytes from 10.123.7.87: icmp_seq=1 ttl=63 time=0.312 ms
64 bytes from 10.123.7.87: icmp_seq=2 ttl=63 time=0.267 ms
向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI