# [solved] Temporarily disable ipv6

## ComputerNerd

I switch between two networks frequently one has ipv6 support the other does not. On the ipv4 network wget will not work unless I use -4 switch however I also need to access github on the network that does not support ipv6 and thus cannot resolve github.com. Git does not appear to have a -4 switch like wget does which solves the cannot resolve address issues. I do not want to permanently disable ipv6 as the other network that I use supports it. So I was wondering what is a good way that I can disable ipv6 temporarily so that I can resolve github.com.Last edited by ComputerNerd on Tue Jun 04, 2013 9:27 pm; edited 1 time in total

----------

## kurly

You shouldn't need to disable IPv6 to use your computer on an IPv4 network; I take my laptop between networks that do and do not have IPv6.  I'm thinking there's something broken with the router or potentially your DNS settings.  Can you tell us more about your computer's network settings and potentially the two networks you are on?  What do pages like http://test-ipv6.com/ say from the network that either has broken or no IPv6 (the "IPv4-only" network)?  Does ifconfig indicate any not-link-local IPv6 addresses when you are connected to the "IPv4-only" network?

----------

## Darknight

Try and see if sysctl can do what you need.

Something like echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6

----------

## ComputerNerd

Sadly the sysctl does not appear to work. Here are the results from http://test-ipv6.com/

```

Test with IPv4 DNS record       

ok (1.087s) using ipv4

Test with IPv6 DNS record       

bad (0.604s)

Test with Dual Stack DNS record       

ok (1.158s) using ipv4

Test for Dual Stack DNS and large packet       

ok (1.956s) using ipv4

Test IPv4 without DNS       

ok (2.039s) using ipv4

Test IPv6 without DNS       

bad (0.045s)

Test IPv6 large packet       

bad (0.744s)

Test if your ISP's DNS server uses IPv6       

bad (0.196s)

Find IPv4 Service Provider       

ok (0.247s) using ipv4 ASN 209

Find IPv6 Service Provider       

bad (0.592s)

```

Here is what ifconfig says about my network

```

eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether [Mac address omitted]  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Local Loopback)

        RX packets 1296  bytes 99624 (97.2 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 1296  bytes 99624 (97.2 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.0.69  netmask 255.255.255.0  broadcast 255.255.255.255

        ether [Mac address omitted]  txqueuelen 1000  (Ethernet)

        RX packets 24916  bytes 9794038 (9.3 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 24445  bytes 3012355 (2.8 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

----------

## Darknight

Quite strange. You don't have an ipv6 address and the test confirms, so basically you cannot use ipv6 and git should just use v4.

----------

## Darknight

And by the way: github does not have an ipv6 address.

I'd double-check your dns settings.

----------

## ComputerNerd

Even stranger github works in google chrome. Right now I am using opendns on the ipv4 only network. I also tried google's public DNS and got the same resualts. When I do wget github.com I must add the -4 switch or else it will not work. This is also true for many other websites including gentoo.org works in chrome but wget requires the -4 switch.Edit fixed. I edited /etc/resolv.conf to also use the opendns nameservers in addition to my router.

----------

