There is a new Azure Linux VM (Ubuntu 22.04 LTS x64), with the following two network interface cards (NICs):
eth0
Mac Address: 00:22:48:8f:ba:bf
Private IPV4 Address: 10.0.0.4
Public IPV4 Address: 20.25.226.73
Private IPV6 Address: abc:abc:abc:abc::6
Public IPV6 Address: 2a01:111:f100:1000::9d37:d42b
eth1
Mac Address: 00:22:48:8f:64:21
Private IPV4 Address: 10.0.0.14
Public IPV4 Address: 172.183.16.91
Private IPV6 Address: abc:abc:abc:abc::16
Public IPV6 Address: 2603:1030:603::324
Both the NICs use the vnet subnet 10.0.0.0/24 and abc:abc:abc:abc::/64, and both use the firewall inbound rules with 22/80/443/3389/ICMP ports allowed.
According to Configure multiple network interfaces in Azure Linux virtual machines (https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux-vm-multiple-virtual-network-interfaces-configuration?tabs=1subnet%2Cubuntu), I have set the following /etc/netplan/50-cloud-init.yaml file:
network:
ethernets:
eth0:
dhcp4: true
dhcp4-overrides: &id001
route-metric: 100
dhcp6: true
dhcp6-overrides: *id001
match:
driver: hv_netvsc
macaddress: 00:22:48:8f:ba:bf
set-name: eth0
routes:
- to: 10.0.0.0/24
via: 10.0.0.1
metric: 100
table: 200
- to: 0.0.0.0/0
via: 10.0.0.1
table: 200
routing-policy:
- from: 10.0.0.4/32
table: 200
- to: 10.0.0.4/32
table: 200
eth1:
dhcp4: true
dhcp4-overrides: &id002
route-metric: 200
dhcp6: true
dhcp6-overrides: *id002
match:
driver: hv_netvsc
macaddress: 00:22:48:8f:64:21
set-name: eth1
routes:
- to: 10.0.0.0/24
via: 10.0.0.1
metric: 200
table: 201
- to: 0.0.0.0/0
via: 10.0.0.1
table: 201
routing-policy:
- from: 10.0.0.14/32
table: 201
- to: 10.0.0.14/32
table: 201
version: 2
After applying the above yaml file, everything on both IPV4 addresses runs well, such as ping each other and putting websites linked to them.
For public IPV6 addresses, things are complicated. As the Limitation part of What is IPv6 for Azure Virtual Network says (https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/ipv6-overview): "ICMPv6 isn't currently supported in Network Security Groups." We cannot use the "ping6" command but need to use another method to test the availability of public IPV6 addresses. One of the methods is using "telnet -6 ipv6.telnetmyip.com" command.
- We login to SSH shell (like Xshell) with eth0 information (public IPV4 first, then try public IPV6), and input "telnet -6 ipv6.telnetmyip.com", it both responses:
Trying 2600:1f16:227:6200::100...
Connected to ipv6.telnetmyip.com.
The escape character is '^]'.
{
"comment": "## Your IP Address is 2a01:111:f100:1000::9d37:d42b (51152) ##",
"family": "ipv6",
"ip": "2a01:111:f100:1000::9d37:d42b",
"port": "51152",
"protocol": "telnet",
"version": "v1.3.0",
"website": "https://github.com/packetsar/checkmyip",
"sponsor": "Sponsored by ConvergeOne, https://www.convergeone.com/"
}
Connection closed by foreign host.
Fine, the system runs well with a public IPV6 address of eth0. That means I needn't modify anything of eth0 in the YAML file.
- We login to SSH shell (like Xshell) with eth1 public IPV4, and input "telnet -6 ipv6.telnetmyip.com", it reponses:
Trying 2600:1f16:227:6200::100...
Connected to ipv6.telnetmyip.com.
The escape character is '^]'.
{
"comment": "## Your IP Address is 2a01:111:f100:1000::9d37:d42b (55926) ##",
"family": "ipv6",
"ip": "2a01:111:f100:1000::9d37:d42b",
"port": "55926",
"protocol": "telnet",
"version": "v1.3.0",
"website": "https://github.com/packetsar/checkmyip",
"sponsor": "Sponsored by ConvergeOne, https://www.convergeone.com/"
}
Connection closed by foreign host.
Oops! it does not recognize the public IPV6 address of eth1, but using the public IPV6 address of eth0
So, how can I edit the YAML file to make the public IPV6 address of eth1 available?
(I've tried to throw the problem to ChatGPT 4 and Claude 2, but both their answers are not working.)