운영체제/RHEL&CENTOS
[Linux] KVM VM에 네트워크 인터페이스 추가 하기
louky
2019. 6. 26. 15:19
반응형
KVM에서 네트워크를 추가하고 실행중인 VM에 네트워크 인터페이스를 추가 하는 방법이다.
게스트 OS를 종료 한다.
[root@cronus ~]# virsh shutdown centos76
도메인 centos76가 종료됨
virsh edit로 해당 VM의 XML을 수정한다.
[root@cronus ~]# virsh edit centos76
~(생략)
<interface type='bridge'>
<mac address='52:54:00:f4:db:a0'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
## 하위에 새로운 네트워크 정보 추가
<interface type='network'>
<source network='internal1'/> ## virsh net-list해서 출력되는 이름으로 입력한다.
<model type='virtio'/>
</interface>
:wq!저장
** 제대로된 정보가 아닌 경우 정상적으로 저장이 안된다.
상기와 같이 네트워크 정보를 입력하고 해당 VM을 실행하면 추가한 네트워크 인터페이스 부분에 맥어드레와 PCI정보가 추가된다.
<interface type='network'>
<mac address='52:54:00:7e:ca:94'/> ##<<<<<< VM기동후 자동으로 추가
<source network='internal1'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> ### << VM기동 후 자동으로 추가
</interface>
반응형