From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Frederic Sowa Subject: Re: Trying to implement secondary loopback Date: Fri, 15 Mar 2013 16:15:28 +0100 Message-ID: <20130315151528.GA10503@order.stressinduktion.org> References: <514326FF.6020205@hhi.fraunhofer.de> <51432B72.20408@hhi.fraunhofer.de> <51432E13.5060003@hhi.fraunhofer.de> <514331BC.4080802@hhi.fraunhofer.de> <5143353C.3050107@hhi.fraunhofer.de> <51433934.3080405@hhi.fraunhofer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: richard -rw- weinberger , "Eric W. Biederman" , "netdev@vger.kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "herbert@gondor.apana.org.au" To: Thomas Martitz Return-path: Received: from order.stressinduktion.org ([87.106.68.36]:37452 "EHLO order.stressinduktion.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754639Ab3COPPa (ORCPT ); Fri, 15 Mar 2013 11:15:30 -0400 Content-Disposition: inline In-Reply-To: <51433934.3080405@hhi.fraunhofer.de> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Mar 15, 2013 at 04:07:32PM +0100, Thomas Martitz wrote: > Same result. I assumed the kernel treats lo in a special way for > localhost-connections and that it would be impossible to achieve the > same with a custom interface. > > I did the following: > > ifconfig lo down > insmod ./mykmod.ko > ifconfig eth2 up > ifconfig eth2 127.0.0.1 > > At this point ifconfig prints the same information for eth2 that it had > printed for lo before (except for the LOOPBACK flag, but I can enable > that one as well by adding IFF_LOOPBACK to the interface flags in the > module). Yet my test application only works with lo, not eth2. 127.0.0.0/8 is guarded by the kernel, but there is a sysctl for relaxing the checks, /proc/sys/net/ipv4/conf/route_localnet. You could give it a try.