Score:-1

How can I disable IP forwarding from IPv6 toIPv4

us flag

I have IPv4 and ipv6 addresses on my network card, when I send a request with curl I want only the respective IPv4 or IPv6 to be used and no fallback e.g. When IPv6 to IPv4 takes place.

curl --interface XXXX: c020: XXXX: e601: XXXX: 596c: XXXX: db97 http://ip4only.me/api/

curl: (45) bind failed with error 22: Invalid argument

curl -x http: // [2603: XXXX: 8003: e601: XXXX: 596c: XXXX: db97]: 8080 http://ip4only.me/api/

IPv4,130.XX.XXX.81

I would like to receive an error if the site only accepts IPv4 addresses, as with the --interface variant.

IPv4 forwarding is switched off.

ubuntu @ app-1: ~ $ sudo grep -r ip_forward / etc
/etc/ufw/sysctl.conf:#net/ipv4/ip_forward=1
/etc/sysctl.conf:#net.ipv4.ip_forward=1

Apparently, a forwarding takes place anyway when I send it with a port.

Score:1
cz flag

You can override which IP protocol stack is used with the -4 and -6 options, which restrict it to IPv4 or IPv6 respectively. Consider:

$ curl -6 http://ip4only.me/api/
curl: (6) Could not resolve host: ip4only.me

$ curl -4 http://ip4only.me/api/
IPv4,198.51.100.84,Remaining fields reserved for future use,,,
us flag
I know but I want the server based no forwarding does not take place via a curl command
Michael Hampton avatar
cz flag
@MyraSewitz Sorry, I don't understand what you mean. There is no forwarding here already. Do you mean something else?
us flag
I would like if an IP V6 address was set in tcp_outgoing_address that then only iPv6 without IP V4 fallback is used in my case I always get an iPv4 fallback if the server only accepts IP V4 and I want to switch it off I would like to receive an error message when I with an iPv6 address I want to connect to a server that only accepts IP V4 addresses
Michael Hampton avatar
cz flag
@MyraSewitz I'm still having some trouble understanding your comments. I think you want to receive an error if you try to connect via IPv6 but the web site only supports IPv4. The command posted above already does this. If there is something else, please be specific. You might also want to ask a fluent English speaker to help you compose your comments.
us flag
Thanks for helping but i dont think i will get a solution here therefore i will close the question
us flag
I will use squid proxy, I would like if an IP V6 address was set in tcp_outgoing_address that then only iPv6 without IP V4 fallback is used in my case I always get an iPv4 fallback if the server only accepts IP V4 and I want to switch it off I would like to receive an error message when I with an iPv6 address I want to connect to a server that only accepts IP V4 addresses
Michael Hampton avatar
cz flag
@MyraSewitz Huh? You asked about curl, not squid. If you asked about squid at the beginning then maybe this would all make some sense and you could get a solution faster.
us flag
Sry for that can you help me
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.