-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: "Libvirt" | ||
date: 2024-07-27T22:57:08+08:00 | ||
draft: false | ||
toc: true | ||
tags: [libvirt,virsh] | ||
--- | ||
|
||
## `virsh` 命令 | ||
|
||
### `virsh domifaddr` 查看虚拟机网卡ip | ||
|
||
|
||
```bash | ||
# virsh domifaddr k3s-node01 --source lease | ||
Name MAC address Protocol Address | ||
------------------------------------------------------------------------------- | ||
``` | ||
|
||
通过arp获取网卡ip | ||
|
||
```bash | ||
# virsh domifaddr k3s-node01 --source arp | ||
Name MAC address Protocol Address | ||
------------------------------------------------------------------------------- | ||
vnet18 52:54:00:0e:08:02 ipv4 192.168.1.248/0 | ||
``` | ||
|
||
通过qemu guest agent获取网卡ip | ||
|
||
```bash | ||
# virsh domifaddr k3s-node01 --source agent | ||
Name MAC address Protocol Address | ||
------------------------------------------------------------------------------- | ||
lo 00:00:00:00:00:00 ipv4 127.0.0.1/8 | ||
enp1s0 52:54:00:0e:08:02 ipv4 192.168.1.248/24 | ||
flannel.1 92:61:59:0c:29:90 ipv4 10.42.0.0/32 | ||
cni0 42:fb:8d:3e:c1:a4 ipv4 10.42.0.1/24 | ||
vethde547696 da:18:a8:b2:ed:f0 N/A N/A | ||
vethe1841f6e ce:79:fc:e1:1e:0b N/A N/A | ||
veth464995dc 82:a9:3b:a6:b5:49 N/A N/A | ||
veth2370e2ac 4a:c8:32:5c:fb:34 N/A N/A | ||
``` |
This file was deleted.
Oops, something went wrong.