Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Possibility to create a kernel without IPv6?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 181
Location: Tsuruga, Japan

PostPosted: Mon Feb 26, 2018 2:07 am    Post subject: Possibility to create a kernel without IPv6? Reply with quote

Environment: university computer network with high capacity internet connection.

Since more than a year, I have noticed a problem with internet connections at work, which seems to only affect linux PCs. The symptoms are simple: it takes a long time to set up a connection to a website; once the website has been contacted the data is downloaded quickly. WIth Windows machines there is absolutely no problem.

Downloading software packages for Gentoo updates is also excruciatingly slow. Here I noticed the following pattern:

- the download server is accessed with an IPv6 address, which always times out
- then the next server is tried with IPv6 and times out
- repeat until servers exhausted

When I set GENTOO_MIRRORS, the process is as follows:

- the GENTOO_MIRROR is accessed with IPv6, which times out
- when the IPv6 times out, portage tries again with IPv4 address, which works immediately

I have a feeling that something is going with our network servers (the university is behind a big firewall, with very few open ports). Perhaps the university servers somehow do not like IPv6.

Thus, I thought it might be worthwhile to test whether things are better if I disable IPv6 in Gentoo. But..... is that possible? Or is there an easy way (perhaps in a configuration file) to tell network applications to prefer IPv4 over IPv6?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5327

PostPosted: Mon Feb 26, 2018 5:12 am    Post subject: Reply with quote

Add this to make.conf to disable IPv6 in portage (the manpage doesn't say when the backslashes are required, so try removing those if it doesn't work):
Code:
FETCHCOMMAND='wget --inet4-only -t 3 -T 60 --passive-ftp -O "\${DISTDIR}/\${FILE}" "\${URI}"'

Or just add inet4-only to /etc/wgetrc to make it global. Browsers shouldn't need extra configuration.
Back to top
View user's profile Send private message
mike155
l33t
l33t


Joined: 17 Sep 2010
Posts: 667
Location: Frankfurt, Germany

PostPosted: Mon Feb 26, 2018 8:50 am    Post subject: Reply with quote

If you don't need IPv6 at all, you could boot Linux with kernel option 'ipv6.disable=1'.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6875

PostPosted: Mon Feb 26, 2018 1:45 pm    Post subject: Reply with quote

like mike155 said but also two other choices:

temp disable it but you have boot with ipv6 kernel and ipv6 up
Code:
echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6


or build a kernel without ipv6 support
Code:
# CONFIG_IPV6 is not set
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 181
Location: Tsuruga, Japan

PostPosted: Tue Feb 27, 2018 2:26 am    Post subject: Reply with quote

Ant P. wrote:
Add this to make.conf to disable IPv6 in portage (the manpage doesn't say when the backslashes are required, so try removing those if it doesn't work):
Code:
FETCHCOMMAND='wget --inet4-only -t 3 -T 60 --passive-ftp -O "\${DISTDIR}/\${FILE}" "\${URI}"'

Or just add inet4-only to /etc/wgetrc to make it global. Browsers shouldn't need extra configuration.


I set

prefer-family = IPv4

in /etc/wgetrc and that really improves performance on emerge-webrsync etc. So that is already a good start! I will also try the other suggestions to prefer IPv4 for other network applications.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 181
Location: Tsuruga, Japan

PostPosted: Tue Feb 27, 2018 2:28 am    Post subject: Reply with quote

krinn wrote:
like mike155 said but also two other choices:

temp disable it but you have boot with ipv6 kernel and ipv6 up
Code:
echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6


or build a kernel without ipv6 support
Code:
# CONFIG_IPV6 is not set


In menuconfig:

Networking Support -> Networking options -> The IPv6 Protocol -> should I simply de-select everything here?
Back to top
View user's profile Send private message
mike155
l33t
l33t


Joined: 17 Sep 2010
Posts: 667
Location: Frankfurt, Germany

PostPosted: Tue Feb 27, 2018 8:44 am    Post subject: Reply with quote

Quote:
should I simply de-select everything here?

If you want to go that way: don't de-select options inside of 'Networking Support -> Networking options -> The IPv6 Protocol'. De-select 'Networking Support -> Networking options -> The IPv6 Protocol' itself.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 181
Location: Tsuruga, Japan

PostPosted: Wed Feb 28, 2018 4:32 am    Post subject: Reply with quote

mike155 wrote:
If you want to go that way: don't de-select options inside of 'Networking Support -> Networking options -> The IPv6 Protocol'. De-select 'Networking Support -> Networking options -> The IPv6 Protocol' itself.


But it seems that it is not possible to de-select "The IPv6 Protocol" in its entirety.

For now, I have used the trick to disable to IPv6 protocol via /sys/proc/... and that is already greatly improving the situation. For now, I think I will just wait and see where we go from here.
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 1622
Location: Here and Away Again

PostPosted: Wed Feb 28, 2018 10:56 am    Post subject: ><)))°€ Reply with quote

WvR wrote:
But it seems that it is not possible to de-select "The IPv6 Protocol" in its entirety.

It appears to be forcefully enabled in cases where

Code:
GENTOO_LINUX_INIT_SYSTEMD [=y] && GENTOO_LINUX [=y] && GENTOO_LINUX_UDEV [=y]

is true.
_________________
Kind Regards,
~ The Noob Unlimited ~

Sore wa sore, kore wa kore.
Back to top
View user's profile Send private message
gengreen
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2017
Posts: 81

PostPosted: Thu Mar 08, 2018 12:06 am    Post subject: Reply with quote

Unrelated to the main question but as I also remove the ipv6 support from whenever I can, add the useflag -ipv6 to your make.conf can be useful.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1340

PostPosted: Mon Mar 12, 2018 7:20 pm    Post subject: Reply with quote

I would guess in 2018 most Gentoo users are on a network that does not use IPV6 at all.
I have no problem with the idea of IPV6 it sounds great.
But somehow on Gentoo systems DNS first queries IPV6 waits for a timeout then uses IPV4, this slows my internet down to a crawl.
DNS on Gnu/Linux seems to prefer IPV6, and in my experience Linux software gets buggy with IPV6 not compiled in.
I would try this first:
mike155 wrote:
If you don't need IPv6 at all, you could boot Linux with kernel option 'ipv6.disable=1'.

That works well for me, no need to have use flags or kernel compiled without IPV6.
No special settings to remember etc..

On other nix systems I was able to fix this DNS preference for IPV6 in
Code:
/etc/gai.conf

By adding something like:
Code:

scopev4 ::ffff:169.254.0.0/112  2
scopev4 ::ffff:127.0.0.0/104    2
scopev4 ::ffff:0.0.0.0/96       14

And there may be a way to disable IPV6 for DNS completely in that file?
Someone might chime in here with that.
Cheers
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum