0

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)

1 Answers1

1

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 :(