Score:0

how to use ipv6 subnet (2302:1400:3010:3731:0:1/96) for outbound connection from linux?

cn flag

how to use 2302:1400:3010:3731:0:1/96 subnet for outbound connection from linux?

I'm trying to use something like this curl --interface 2302:1400:3010:3731:0:1:5fff:8 ifconfig.co in GCP VM

this is working if I add with ip -6 addr add 2302:1400:3010:3731:0:1:5fff:8/128 dev ens4, but I want to use all address of 2302:1400:3010:3731:0:1/96 or at least 2302:1400:3010:3731:0:1/112

but if I add with ip -6 addr add 2302:1400:3010:3731:0:1:5fff::/112 dev ens4, curl is not working, giving error with (99: Cannot assign requested address)

vidarlo avatar
ar flag
Who gave you that IP address?
Goli Nikitha avatar
ng flag
Are you trying to add VM's to a primary network interface or secondary network interface? Make sure the IPv6 is enabled in the subnet first and next in the VM. Refer this [documentation](https://cloud.google.com/vpc/docs/using-vpc#subnet-enable-ipv6) for more information on enabling IPv6 and refer this [documentation](https://cloud.google.com/vpc/docs/vpc#ipv6-addresses) for details on IPv6.
cn flag
@GoliNikitha as I stated above, if I use /128 its working fine, but I can't a way to use any ip in that range, its enabled in subnet, vm as /96 to main interface. I followed same links what you shared.
cn flag
@vidarlo its in GCP
Score:1
cn flag

After many tries with different options, finally adding addr and route along with enabling net.ipv6.ip_nonlocal_bind doing trick

ip add add local 2302:1400:3010:3731:0:1/96 dev lo
ip route add local 2302:1400:3010:3731:0:1/96 dev ens4
sysctl net.ipv6.ip_nonlocal_bind=1

Reference: https://serverfault.com/a/971732/225853

make this question duplicate :(

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.