You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -97,27 +97,27 @@ VPC Private Networks to which the Instance is connected will appear as virtio PC
97
97
98
98
As all PCI devices, they can be listed with the `lspci` command:
99
99
100
-
```sh
100
+
```bash
101
101
102
102
root@test-instance:~# lspci -d '::0200'
103
103
00:02.0 Ethernet controller: Red Hat, Inc. Virtio network device
104
104
00:05.0 Ethernet controller: Red Hat, Inc. Virtio network device
105
-
```bash
105
+
00:06.0 Ethernet controller: Red Hat, Inc. Virtio network device
106
106
```
107
107
108
108
The filter selects the Network controller device class/Ethernet controller device subclass. Three PCI devices are visible, which correspond to the public network device, and two VPC Private Network devices.
109
109
By itself, the output of this command is not enough to distinguish between public and private networks, and can not distinguish between multiple private networks either: this simply confirms their existence in the PCI hierarchy of the Instance.
110
110
111
111
More interestingly, network interfaces can be listed generically using the `ip link show` command:
112
112
113
-
```sh
113
+
```bash
114
114
root@test-instance:~# ip link show
115
115
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
4: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
@@ -130,8 +130,8 @@ Here, four interfaces are listed, one of which (`lo`) is the virtual loopback in
130
130
A simple and effective way to distinguish the public network interface from the VPC Private Network interfaces is the MAC address prefix. VPC Private Network interfaces always have a MAC address starting with `02:00:00`.
131
131
132
132
Using the JSON output mode of the `ip` command and filtering with the `jq` JSON parser, we can thus list VPC Private Network interfaces:
133
+
133
134
```bash
134
-
```sh
135
135
root@test-instance:~# ip -j link | jq -r '.[] | select(.address | test("02:00:00:.*")) | .ifname'
136
136
ens5
137
137
ens6
@@ -140,7 +140,7 @@ ens6
140
140
Using the MAC address of the interfaces, it is also possible to distinguish between the different VPC Private Network interfaces. The MAC address of each interface is available through the API.
141
141
For example, querying `/instances/v1/<zone>/servers/<uuid>/private_nics`, where `<zone>` is the zone of the server and `<uuid>` is the ID of the Instance gives:
142
142
143
-
```sh
143
+
```bash
144
144
{
145
145
"private_nics": [
146
146
{
@@ -151,7 +151,7 @@ For example, querying `/instances/v1/<zone>/servers/<uuid>/private_nics`, where
0 commit comments