View previous topic :: View next topic |
Author |
Message |
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1741
|
Posted: Fri Jun 26, 2020 9:09 am Post subject: How do I (temporarily) specify an IPv4 rsync server? |
|
|
Does some way exist even to do that? Yes, I know that I can set a specific mirror, but sometimes I find myself connecting to the internet in places where the hardware doesn't support IPv6. I would like to have the capability of specifying IPv4 on the command line (something like "emerge -4 --sync", or even having portage failover to IPv4 when it can't connect to an IPv6 address.
Thank you in advance. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Jun 26, 2020 10:36 am Post subject: |
|
|
`ip -6 route flush scope global` might help, should cause it to fail immediately trying to connect to outside v6 addresses. |
|
Back to top |
|
|
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1741
|
Posted: Sun Jun 28, 2020 7:55 am Post subject: |
|
|
Ant P. wrote: | `ip -6 route flush scope global` might help, should cause it to fail immediately trying to connect to outside v6 addresses. |
It does fail immediately (even without that command, since I only have an IPv4 address when connecting at certain locations). The command returns this:
Code: |
# emerge --sync
>>> Syncing repository 'gentoo' into '/usr/portage'...
>>> Starting rsync with rsync://89.238.71.6/gentoo-portage...
>>> Checking server timestamp ...
rsync: safe_read failed to read 1 bytes [Receiver]: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(276) [Receiver=3.1.3]
>>> Retrying...
>>> Starting retry 1 of 1 with rsync://[2a00:1828:a00d:ffff::6]/gentoo-portage
>>> Checking server timestamp ...
rsync: failed to connect to 2a00:1828:a00d:ffff::6 (2a00:1828:a00d:ffff::6): Cannot assign requested address (99)
rsync error: error in socket IO (code 10) at clientserver.c(127) [Receiver=3.1.3]
>>> Retrying...
!!! Exhausted addresses for rsync.gentoo.org
q: Updating ebuild cache in /usr/portage ...
q: Finished 32612 entries in 68.230023 seconds
Action: sync for repo: gentoo, returned code = 1
|
Actually, the error in data stream message might have something to do with it, but I don't know the cause of that (or how to fix it) either. :) I still think that portage should never try to connect with IPv6 if the client doesn't have an IPv6 address. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Sun Jun 28, 2020 8:33 am Post subject: |
|
|
another solution: Use "mirrorselect -4" |
|
Back to top |
|
|
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1741
|
Posted: Sun Jun 28, 2020 10:44 pm Post subject: |
|
|
toralf wrote: | another solution: Use "mirrorselect -4" |
Yes, I know I can do that, but I asked for a temporary solution (without changing mirrors, which I most likely will forget to change back when I reconnect to a network that supports IPv6). I would like to have the ability to specify "use IPv4 just this one time" (yes, I use a mirror that supports both). |
|
Back to top |
|
|
Josef.95 Advocate
Joined: 03 Sep 2007 Posts: 4552 Location: Germany
|
Posted: Mon Jun 29, 2020 2:38 pm Post subject: How do I (temporarily) specify an IPv4 rsync server? |
|
|
Not sure, but I think Code: | FETCHCOMMAND_RSYNC="${FETCHCOMMAND_RSYNC} -4" emerge --sync | should probably work. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Tue Jun 30, 2020 1:30 am Post subject: |
|
|
The idea is a sound one, but I think as written, it will not work. OP likely does not have a shell environment variable named FETCHCOMMAND_RSYNC, so the use of the variable will expand to nothing, and the resulting variable will not be a valid command. Putting the same in make.conf might work, or OP could look up the stock value of FETCHCOMMAND_RSYNC and assign that first.
On further consideration, it might be easier to use PORTAGE_RSYNC_EXTRA_OPTS, which defaults to nothing, but is added to the relevant command. |
|
Back to top |
|
|
|