[PATCH] appliance: Disable ipv6 in the appliance because qemu usernet is ipv4 only
Signed-off-by: Olaf Hering <olaf@aepfle.de> --- Untested in this environment. appliance/init | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appliance/init b/appliance/init index b25ea26..cc8c978 100755 --- a/appliance/init +++ b/appliance/init @@ -71,6 +71,10 @@ for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do echo noop > $f; done # Update the system clock. hwclock -u -s +# Disable ipv6 because host names resolve to ipv4 and ipv6 +# Resolver may prefer ipv6 and qemu usernet does only ipv4 +for f in /proc/sys/net/ipv6/conf/*/disable_ipv6; do if test -w $f ; then echo 1 > $f; fi; done + # Set up the network. ip addr add 127.0.0.1/8 brd + dev lo scope host ip link set dev lo up
On Thu, Jan 23, 2014 at 11:46:33PM +0100, Olaf Hering wrote:
On Thu, Jan 23, Olaf Hering wrote:
+++ b/appliance/init # Update the system clock. hwclock -u -s
Why is that needed? Just wondering...
I suspect it's not needed at all. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On Fri, Jan 24, 2014 at 10:26:22AM +0000, Richard W.M. Jones wrote:
On Thu, Jan 23, 2014 at 11:46:33PM +0100, Olaf Hering wrote:
On Thu, Jan 23, Olaf Hering wrote:
+++ b/appliance/init # Update the system clock. hwclock -u -s
Why is that needed? Just wondering...
I suspect it's not needed at all.
Actually I looked into this, and it is needed. We added it to fix a bug, which was to do with files being created with the wrong dates & times. On the other hand it may not be necessary now. I tried commenting it out and doing various tests, and the dates of files seem correct (even with TCG with is not using kvm-clock). It doesn't seem to do any harm to keep it. 'time' indicates that it takes 0.14 seconds to run (on my laptop, with KVM). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On Thu, Jan 23, 2014 at 11:44:52PM +0100, Olaf Hering wrote:
Signed-off-by: Olaf Hering <olaf@aepfle.de> ---
Untested in this environment.
appliance/init | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/appliance/init b/appliance/init index b25ea26..cc8c978 100755 --- a/appliance/init +++ b/appliance/init @@ -71,6 +71,10 @@ for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do echo noop > $f; done # Update the system clock. hwclock -u -s
+# Disable ipv6 because host names resolve to ipv4 and ipv6 +# Resolver may prefer ipv6 and qemu usernet does only ipv4 +for f in /proc/sys/net/ipv6/conf/*/disable_ipv6; do if test -w $f ; then echo 1 > $f; fi; done
There's no error checking in init, so this should work: for f in /proc/sys/net/ipv6/conf/*/disable_ipv6; do echo 1 > $f; done However I don't understand why disabling IPv6 should be necessary. If sites resolve to AAAA+A records, then presumably it's going to choose the A (IPv4) route since no IPv6 route exists. If a site resolves to only an AAAA record, then it's not reachable whatever we do. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On Fri, Jan 24, Richard W.M. Jones wrote:
However I don't understand why disabling IPv6 should be necessary. If sites resolve to AAAA+A records, then presumably it's going to choose the A (IPv4) route since no IPv6 route exists. If a site resolves to only an AAAA record, then it's not reachable whatever we do.
For me the code tries to reach the ipv6 address, which wont work. Olaf
On Fri, Jan 24, 2014 at 11:55:26AM +0100, Olaf Hering wrote:
On Fri, Jan 24, Richard W.M. Jones wrote:
However I don't understand why disabling IPv6 should be necessary. If sites resolve to AAAA+A records, then presumably it's going to choose the A (IPv4) route since no IPv6 route exists. If a site resolves to only an AAAA record, then it's not reachable whatever we do.
For me the code tries to reach the ipv6 address, which wont work.
Do you have a demonstration of this? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On Fri, Jan 24, Richard W.M. Jones wrote:
On Fri, Jan 24, 2014 at 11:55:26AM +0100, Olaf Hering wrote:
On Fri, Jan 24, Richard W.M. Jones wrote:
However I don't understand why disabling IPv6 should be necessary. If sites resolve to AAAA+A records, then presumably it's going to choose the A (IPv4) route since no IPv6 route exists. If a site resolves to only an AAAA record, then it's not reachable whatever we do.
For me the code tries to reach the ipv6 address, which wont work.
Do you have a demonstration of this?
It seems mount defaults to nfsvers=4, which tries first ipv4 then ipv6. See log files. Olaf
participants (2)
-
Olaf Hering -
Richard W.M. Jones