Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #247235 > unrolled thread
| Started by | wilson <info@bigcount.xyz> |
|---|---|
| First post | 2022-04-15 13:50 +0200 |
| Last post | 2022-04-16 02:20 +0200 |
| Articles | 16 on this page of 36 — 17 participants |
Back to article view | Back to linux.debian.user
disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-15 13:50 +0200
Re: disable IPv6 debian 황병희 <soyeomul@doraji.xyz> - 2022-04-15 14:00 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-15 14:30 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-15 17:00 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-15 18:00 +0200
Re: disable IPv6 debian Tim Woodall <debianuser@woodall.me.uk> - 2022-04-15 18:10 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 02:10 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 02:20 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 02:30 +0200
Re: disable IPv6 debian Charles Curley <charlescurley@charlescurley.com> - 2022-04-16 02:40 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 02:50 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 03:10 +0200
Re: disable IPv6 debian The Wanderer <wanderer@fastmail.fm> - 2022-04-16 03:50 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 04:10 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 05:00 +0200
Re: disable IPv6 debian The Wanderer <wanderer@fastmail.fm> - 2022-04-16 14:10 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 15:10 +0200
Re: disable IPv6 debian David Wright <deblis@lionunicorn.co.uk> - 2022-04-16 18:10 +0200
Re: disable IPv6 debian <tomas@tuxteam.de> - 2022-04-16 08:20 +0200
Re: disable IPv6 debian Tim Woodall <debianuser@woodall.me.uk> - 2022-04-16 08:40 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 10:30 +0200
Re: disable IPv6 debian David <bouncingcats@gmail.com> - 2022-04-16 10:50 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 15:00 +0200
Re: disable IPv6 debian Michael Stone <mstone@debian.org> - 2022-04-16 20:00 +0200
Re: disable IPv6 debian <tomas@tuxteam.de> - 2022-04-16 08:20 +0200
Re: disable IPv6 debian Chuck Zmudzinski <brchuckz@netscape.net> - 2022-04-15 19:40 +0200
Re: disable IPv6 debian Andy Smith <andy@strugglers.net> - 2022-04-16 01:00 +0200
Re: disable IPv6 debian didar <nosferatu@purlo.in> - 2022-04-16 07:10 +0200
Re: disable IPv6 debian Andy Smith <andy@strugglers.net> - 2022-04-16 11:50 +0200
Re: disable IPv6 debian Reco <recoverym4n@enotuniq.net> - 2022-04-15 14:30 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-15 14:40 +0200
Re: disable IPv6 debian Erwan David <erwan@rail.eu.org> - 2022-04-15 16:00 +0200
Re: disable IPv6 debian Jeremy Ardley <jeremy@ardley.org> - 2022-04-15 16:20 +0200
Re: disable IPv6 debian Reco <recoverym4n@enotuniq.net> - 2022-04-15 16:20 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 02:20 +0200
Re: disable IPv6 debian Ash Joubert <ash@transient.nz> - 2022-04-16 02:20 +0200
Page 2 of 2 — ← Prev page 1 [2]
| From | wilson <info@bigcount.xyz> |
|---|---|
| Date | 2022-04-16 10:30 +0200 |
| Message-ID | <EcLYB-95yy-3@gated-at.bofh.it> |
| In reply to | #247282 |
does bash shell have the list/array concept? ~$ list="1 2 3 4" ~$ for i in $list; do echo $i; done 1 2 3 4 is this a list access? thanks Tim Woodall wrote: > But if you want to use grep, then you need -w at least. grep for pid 123
[toc] | [prev] | [next] | [standalone]
| From | David <bouncingcats@gmail.com> |
|---|---|
| Date | 2022-04-16 10:50 +0200 |
| Message-ID | <EcMhX-95EI-3@gated-at.bofh.it> |
| In reply to | #247283 |
On Sat, 16 Apr 2022 at 18:20, wilson <info@bigcount.xyz> wrote: > does bash shell have the list/array concept? Hi, this mailing list is very kind, and as part of that kindness I want to offer you some kind advice. First, no mailing list will have the patience to teach you every feature of a programming language, one question at a time. So, here are two excellent websites for self-learning about shell scripting: https://www.shellcheck.net/ and http://mywiki.wooledge.org/BashGuide http://mywiki.wooledge.org/BashFAQ wooledge.org will inform you, and shellcheck.net will correct and advise improvements to any code that you paste into it. Second, a good place to ask for help is on this mailing list specifically for questions about shells and scripting: help-bash@gnu.org which has archives here: https://lists.gnu.org/archive/html/help-bash/ Most of the people who give answers on that list are extremely knowledgable about shell scripting. That's not the case here. Shell scripting is hard, and people who haven't spent a lot of time digging into all the details often do not give good advice. The same is true of the web, a lot of public shell examples are suboptimal in some way. Here's the answer to your question: http://mywiki.wooledge.org/BashGuide/Arrays
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Date | 2022-04-16 15:00 +0200 |
| Message-ID | <EcQbT-9809-1@gated-at.bofh.it> |
| In reply to | #247283 |
On Sat, Apr 16, 2022 at 04:20:15PM +0800, wilson wrote:
> does bash shell have the list/array concept?
Bash has indexed arrays (since forever) and associative arrays (in
version 4.0 and above).
> ~$ list="1 2 3 4"
>
> ~$ for i in $list; do echo $i; done
> 1
> 2
> 3
> 4
>
> is this a list access?
That's a string, and an abuse of word-splitting. It's a common
anti-pattern used in sh scripts, because sh doesn't have arrays or lists.
It "works" in this simple case, and in many other simple cases, where
the "list" elements are known-in-advance words that don't contain any
whitespace or globbing characters (and can't be the empty string).
It completely fails if the list elements contain any of those things.
Most notably, when the list elements are filenames, this approach is
doomed.
Here's how you would do it correctly in bash:
list=(1 '' 2 'two and a half' 3 '3.14*' 4)
for i in "${list[@]}"; do echo "<$i>"; done
The for loop can mostly be replaced by a single printf:
printf '<%s>\n' "${list[@]}"
But there is one difference: if the array is empty (has zero elements),
the printf will still print one time, with an empty string as the
argument. The for loop will not print anything at all.
See also:
https://mywiki.wooledge.org/BashGuide
https://mywiki.wooledge.org/BashFAQ/005
[toc] | [prev] | [next] | [standalone]
| From | Michael Stone <mstone@debian.org> |
|---|---|
| Date | 2022-04-16 20:00 +0200 |
| Message-ID | <EcUSd-9aJf-1@gated-at.bofh.it> |
| In reply to | #247265 |
On Fri, Apr 15, 2022 at 08:16:22PM -0400, Greg Wooledge wrote: >ls -l .bashrc > >You've got a command name, and you're passing two string arguments to >it. If you feel a need to quote every string argument, then you should >be writing it like this: > >ls "-l" ".bashrc" There's nothing special about the command: "ls" "-l" ".bashrc" The key concept is that shell command lines *only* work on strings; unlike other languages, there's no "string" type that needs quotes and the only time you need do quotes is when dealing with special characters like spaces which would be interpreted differently without the quotes.
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2022-04-16 08:20 +0200 |
| Message-ID | <EcJWN-94q5-3@gated-at.bofh.it> |
| In reply to | #247262 |
[Multipart message — attachments visible in raw view] — view raw
On Sat, Apr 16, 2022 at 08:06:23AM +0800, wilson wrote: > > > Greg Wooledge wrote: > > if [ "$1" == on ] > > this sounds strange. why a string doesn't need "" around in shell script? Shell works by text substitution. If you have foo $bar $baz the shell first replaces $bar and $baz by their values. Suppose bar is `123', baz is `a multi-word string', then the next round is foo 123 a multi-word string Then the shell splits the result in words, goes to look up `foo' in all the places $PATH says it should look (yes, I've taken a HUGE shortcut here, chime in to fill the voids ;-), and the command foo (say /usr/local/bin/foo) gets to see four parameters: `123', `a', `multi-word' and `string'. The quotes hold together things; different rules hold for single quotes (do not substitute $vars) and double quotes (do substitute). So if you want to invoke foo with two params, it is foo $bar "$baz" If you don't know whether bar could contain a space and you also want to have bar in one piece, better safe than sorry: foo "$bar" "$baz" Text substitution systems were a thing in the 1970ies..1990ies. They do have interesting properties, and survive in some odd places, the shells being one (TeX, METAFONT, Tcl come to mind, too). And oh, the C preprocessor. Cheers -- t
[toc] | [prev] | [next] | [standalone]
| From | Chuck Zmudzinski <brchuckz@netscape.net> |
|---|---|
| Date | 2022-04-15 19:40 +0200 |
| Message-ID | <Ecy5j-8Xcv-5@gated-at.bofh.it> |
| In reply to | #247239 |
On 4/15/22 8:10 AM, wilson wrote: > no. it's the Hadoop system, which has the possible issue with ipv6. > > thanks > > I would check the documentation for Hadoop - does it have an option to disable ipv6? I would just disable ipv6 for the app that has the issue with ipv6, not for the whole system. I also note that according to the Debian Wiki, Debian does not provide Hadoop packages: https://wiki.debian.org/Hadoop Regards, Chuck
[toc] | [prev] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2022-04-16 01:00 +0200 |
| Message-ID | <EcD4Z-902Q-1@gated-at.bofh.it> |
| In reply to | #247239 |
Hello, On Fri, Apr 15, 2022 at 10:34:25AM -0400, Chuck Zmudzinski wrote: > I have an issue with a few websites that seem to hang with ipv6 If you happen to know their IPv6 addresses and can trust that those assignments will remain stable then you may prefer instead to add prohibited routes for these, e.g. # ip route add prohibit 2001:db8::/32 Your web browser will then fall back to using the IPv4 results that it gets from DNS. Cheers, Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | didar <nosferatu@purlo.in> |
|---|---|
| Date | 2022-04-16 07:10 +0200 |
| Message-ID | <EcIR3-93Oz-1@gated-at.bofh.it> |
| In reply to | #247261 |
On Fri, Apr 15, 2022 at 10:58:01PM +0000, Andy Smith wrote: > Hello, > > On Fri, Apr 15, 2022 at 10:34:25AM -0400, Chuck Zmudzinski wrote: > > I have an issue with a few websites that seem to hang with ipv6 > > If you happen to know their IPv6 addresses and can trust that those > assignments will remain stable then you may prefer instead to add > prohibited routes for these, e.g. Not really. Y! uses both hardware load balancers as well as GSLB (global service load balancing*). During routine maintenance and updates, both facilities are used to move traffic to different targets. > > # ip route add prohibit 2001:db8::/32 > > Your web browser will then fall back to using the IPv4 results that > it gets from DNS. > > Cheers, > Andy > > -- > https://bitfolk.com/ -- No-nonsense VPS hosting > * uses DNS to point to different locations. -- They just buzzed and buzzed...buzzed.
[toc] | [prev] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2022-04-16 11:50 +0200 |
| Message-ID | <EcNe1-96cH-7@gated-at.bofh.it> |
| In reply to | #247278 |
Hello, On Sat, Apr 16, 2022 at 10:39:03AM +0530, didar wrote: > On Fri, Apr 15, 2022 at 10:58:01PM +0000, Andy Smith wrote: > > If you happen to know their IPv6 addresses and can trust that those > > assignments will remain stable then you may prefer instead to add > > prohibited routes for these, e.g. > > Not really. Y! uses both hardware load balancers as well as GSLB (global service > load balancing*). During routine maintenance and updates, both facilities are > used to move traffic to different targets. Sure, it may not be feasible, but it is an alternative to manually having to disable one's entire IPv6 connectivity and then re-enable it later! If you notice a problem with Y! (or whoever) then you may have encountered a new netblock and at that time can just add another prohibited route for it. There won't be many in total and it won't matter if you pick a whole /32 or /29. v6 allocations are purposefully intended to be huge so that organisations won't go back for more and need extra routes in the global routing table. Cheers, Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | Reco <recoverym4n@enotuniq.net> |
|---|---|
| Date | 2022-04-15 14:30 +0200 |
| Message-ID | <Ectfj-8UiU-5@gated-at.bofh.it> |
| In reply to | #247235 |
Hi. On Fri, Apr 15, 2022 at 07:32:01PM +0800, wilson wrote: > What's the good way to disable IPv6 in a debian system? The most non-intrusive way of doing it (side effects considered) is: /sbin/sysctl -w net.ipv6.conf.default.disable_ipv6=1 /sbin/sysctl -w net.ipv6.conf.lo.disable_ipv6=0 Reco
[toc] | [prev] | [next] | [standalone]
| From | wilson <info@bigcount.xyz> |
|---|---|
| Date | 2022-04-15 14:40 +0200 |
| Message-ID | <EctoZ-8UlS-3@gated-at.bofh.it> |
| In reply to | #247237 |
after doing this, do I need to restart the OS? thanks Reco wrote: > The most non-intrusive way of doing it (side effects considered) is: > > /sbin/sysctl -w net.ipv6.conf.default.disable_ipv6=1 > /sbin/sysctl -w net.ipv6.conf.lo.disable_ipv6=0
[toc] | [prev] | [next] | [standalone]
| From | Erwan David <erwan@rail.eu.org> |
|---|---|
| Date | 2022-04-15 16:00 +0200 |
| Message-ID | <EcuEp-8UZG-1@gated-at.bofh.it> |
| In reply to | #247241 |
Le 15/04/2022 à 14:35, wilson a écrit : > after doing this, do I need to restart the OS? > > thanks > > Reco wrote: >> The most non-intrusive way of doing it (side effects considered) is: >> >> /sbin/sysctl -w net.ipv6.conf.default.disable_ipv6=1 >> /sbin/sysctl -w net.ipv6.conf.lo.disable_ipv6=0 > > No. But it won't be kept if you reboot To make it permanent you need to create the file /etc/sysctl.d/10-disable_ipv6.conf with the 2 lines net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=0
[toc] | [prev] | [next] | [standalone]
| From | Jeremy Ardley <jeremy@ardley.org> |
|---|---|
| Date | 2022-04-15 16:20 +0200 |
| Message-ID | <EcuXL-8VlC-1@gated-at.bofh.it> |
| In reply to | #247242 |
[Multipart message — attachments visible in raw view] — view raw
On 15/4/22 9:59 pm, Erwan David wrote: > > No. But it won't be kept if you reboot > To make it permanent you need to create the file > /etc/sysctl.d/10-disable_ipv6.conf with the 2 lines > > net.ipv6.conf.default.disable_ipv6=1 > net.ipv6.conf.lo.disable_ipv6=0 > > However make sure no other file in /etc/sysctl.d is enabling ipv6. It would then come down to which script was executed last e.g. if there was a 20-enable_ipv6.conf or similar. -- Jeremy
[toc] | [prev] | [next] | [standalone]
| From | Reco <recoverym4n@enotuniq.net> |
|---|---|
| Date | 2022-04-15 16:20 +0200 |
| Message-ID | <EcuXL-8VlC-3@gated-at.bofh.it> |
| In reply to | #247241 |
Hi, please do not top-post. On Fri, Apr 15, 2022 at 08:35:33PM +0800, wilson wrote: > Reco wrote: > > The most non-intrusive way of doing it (side effects considered) is: > > > > /sbin/sysctl -w net.ipv6.conf.default.disable_ipv6=1 > > /sbin/sysctl -w net.ipv6.conf.lo.disable_ipv6=0 > > after doing this, do I need to restart the OS? No, you do not need to reboot. Moreover, those sysctls are non-persistent, and that's intentional. If you need to persist those settings, you'll need to modify /etc/sysctl.conf or create a new file in /etc/sysctl.d. Please consider reading sysctl.conf(5) *before* you touch those. Reco
[toc] | [prev] | [next] | [standalone]
| From | wilson <info@bigcount.xyz> |
|---|---|
| Date | 2022-04-16 02:20 +0200 |
| Message-ID | <EcEkp-90W9-5@gated-at.bofh.it> |
| In reply to | #247235 |
Ash Joubert wrote: > To completely and persistently disable all ipv6 support in the kernel, I > add "ipv6.disable=1" to the Linux command line variable > GRUB_CMDLINE_LINUX in /etc/default/grub, run update-grub, and reboot. If > you have other command line arguments, they are separated by whitespace. Thanks. how about adding sysctl commands in /etc/rc.local?
[toc] | [prev] | [next] | [standalone]
| From | Ash Joubert <ash@transient.nz> |
|---|---|
| Date | 2022-04-16 02:20 +0200 |
| Message-ID | <EcEkp-90W9-3@gated-at.bofh.it> |
| In reply to | #247235 |
On 15/04/2022 23:32, wilson wrote: > What's the good way to disable IPv6 in a debian system? To completely and persistently disable all ipv6 support in the kernel, I add "ipv6.disable=1" to the Linux command line variable GRUB_CMDLINE_LINUX in /etc/default/grub, run update-grub, and reboot. If you have other command line arguments, they are separated by whitespace. Kind regards, -- Ash Joubert <ash@transient.nz> Director Transient Software Limited <https://transient.nz/> New Zealand
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.debian.user
csiph-web