Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm doing some IPv6 related testing, and I wanted to fully disable my IPv4 for the tests on Linux, but couldn't find any easy place to do this. How do I make my IPv6 the only active one?

share|improve this question

3 Answers 3

If you are using Network Manager, click on in and select 'Edit Connections'. Then edit the default connection (or the one you are using) and look under the 'IPv4 Settings' tab. There should be a dropdown for method where you can select 'Disabled'.

Remember to activate it when you're finished testing.

If you're not using Network Manager, ip address del <address>/<netmask> dev <device> should do the trick. For example: ip address del 10.0.0.2/24 dev eth0.

share|improve this answer
    
Of course, this doesn't disable IPv4 completly, just on the interface. You'll still have v4 on loopback (lo), but I'm not sure that can be disabled without problems. –  mboehn May 13 '11 at 22:41
1  
Depending on exactly what you're testing, a simpler method yet might be to just drop your IPv4 route to the default GW. –  BMDan May 14 '11 at 0:40

I believe if you edit the /etc/modprobe.d/aliases file and change the following it should work:

alias net-pf-2 ipv4

to:

alias net-pf-2 off

share|improve this answer

imho the best way to do this is to simply not configure an IPv4 address. Additionally you can choose to disable arp:

ip addr del <ipv4 address>/CIDR dev ethN
(operational example: "ip addr del 192.168.0.1/24 dev eth0")
ip link set dev eth0 arp off

I do this on some boxes that should be only reachable via IPv6 for administative purposes (ssh) - boxes that should not be using the routable Internet for anything else. One such example is a database server that uses an IPv6 ULA via OpenVPN so that only internal hosts can connect to it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.