LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how can i disable the ipv6 address only? (https://www.linuxquestions.org/questions/linux-networking-3/how-can-i-disable-the-ipv6-address-only-743309/)

v_fone 07-28-2009 03:27 AM

how can i disable the ipv6 address only?
 
Hello everyone.
I have a host and typing ifconfig I get:

eth0 Link encap:Ethernet HWaddr 00:0E:7F:4F:E4:09
inet addr:130.130.9.9 Bcast:130.130.255.255 Mask:255.255.0.0
inet6 addr: fe80::20e:7fff:fe4f:e409/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3099783807 errors:1 dropped:0 overruns:0 frame:0
TX packets:3730735923 errors:12 dropped:0 overruns:0 carrier:12

and to do a test i want to disable or delete the ipv6 address, but mainteining the other configured parameters.

Looking on the ifcfg config file I have

DEVICE=eth0
BOOTPROTO=static
BROADCAST=130.130.255.255
IPADDR=130.130.9.9
NETMASK=255.255.0.0
NETWORK=130.130.0.0
ONBOOT=yes
TYPE=Ethernet

and nothing about IPv6...

Then, using ifdown-ipv6 could i remove only the ipv6 address?

Thanks

zQUEz 07-28-2009 05:19 AM

I didn't see where you mentioned what distro you are using. If you are using a RHEL based system (RHEL/Centos/Fedora) you can add a line to /etc/sysconfig/network as follows:
Code:

NETWORKING_IPV6=no
then just restart and that should turn off any IPv6.

GrapefruiTgirl 07-28-2009 05:36 AM

Another method, based on the same idea but for another selection of distros:

Create a file in /etc/modprobe.d called something like 'ipv6.conf' or whatever. Inside it, put the following:

alias ipv6 off
alias net-pf-10 off


and inside the networking config script ( on my Slackware-esque system, this is rc.inet1.conf ) place the following:

NETWORKING_IPV6="no"

As mentioned by the earlier poster, we don't know your distro; putting this in your profile so that it appears in the sidebar, will help folks answer you more accurately.

Sasha

PS - if you are interested, and you use Firefox, there is an about:config option which disables IPv6 within the browser, thereby (reputedly) making the browser a little quicker because it doesn't try to resolve/deal-with IPv6, and focuses fully on IPv4. I cannot recall the syntax of the option, but you can easily find this info via Google or similar means.

v_fone 07-29-2009 01:07 AM

Thanks for your answer :)
Well, my distro is RHEL 4&5, sorry for dont tell it previously :$
Then, it's neccesary restart the machine?
Thanks a lot (again :D)

linuxlover.chaitanya 07-29-2009 02:16 AM

I dont think restarting machine is necessary, just restarting network services should be enough.

v_fone 07-30-2009 01:31 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3623876)
I dont think restarting machine is necessary, just restarting network services should be enough.

Well, today i'm going to do the test. When I do it, I'm going to put here the results :)

v_fone 07-30-2009 02:03 AM

Finally, It doesnt work when I restart the service network.
It's neccesary to restart the host...

linuxlover.chaitanya 07-30-2009 02:24 AM

What???? Linux needs a restart???

GrapefruiTgirl 07-30-2009 07:42 AM

Quote:

Originally Posted by v_fone (Post 3625109)
Finally, It doesnt work when I restart the service network.
It's neccesary to restart the host...

If restarting the system rubs you the wrong way, instead try switching to init 1 , then log in and re-switch it back to init 3/4/5 -- this should also accomplish the job.

NOTE: Of course, now that the configuration files are edited to disable the IPv6, this is redundant; every boot-up from now on will have the setting in effect anyhow :p

Sasha

v_fone 07-31-2009 01:31 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3625128)
What???? Linux needs a restart???

Well, I'm also very surprised... but reading other web page found the samething :S
http://www.vincentverhagen.nl/2007/0...v6-on-red-hat/
First I tried to restart the network service but didnt work, so I rebooted the machine.
And Sasha, I dont understand what you are talking about because I'm trying to disable IPv6 so obviously if I reboot the host, IPv6 must not appears using ifconfig command, could you explain your point?
Thanks

GrapefruiTgirl 07-31-2009 07:30 AM

The link you found clearly shows the steps you need to take to accomplish what you are after.

My suggestion (while it may or may not work) of switching to init 1 and then back to a multi-user runlevel (3/4/5) makes no particular point; it was just an idea that one might try if for some reason they were dead set against rebooting the machine.

Many of the configuration scripts & other binaries, which set up the machine during a boot, are not executed when booting into init 1. Therefore, by switching to level 1 and back, the system would RE-execute almost all of the config scripts that it would normally execute at a bootup, thereby hopefully picking up the IPv6 changes and disabling IPv6.

Either way, it seems you have found your answer, and that's the important part-- if this is true, you can mark your thread as [solved] using the 'Thread Tools' dropdown menu above :)

Cheers,

Sasha

v_fone 08-01-2009 04:54 AM

Thanks Sasha for explain the process when switch between run levels :D
And thanks everybody for your answer and support
Best regards


All times are GMT -5. The time now is 08:16 PM.