Subject: Re: Loopback and net namespace

From: Daniel Lezcano <[email-masked]>
Date: Sat, 25 Apr 2009 21:50:14 +0200

David Miller wrote:
> From: [email-masked]
> Date: Fri, 24 Apr 2009 23:55:36 +0200 (CEST)
>
>   
>> Currently it is impossible to use both net namespace and sysfs
>> because sysfs does not allow two devices with the same name
>> and each net namespace has to have loopback device.
>>
>> To have this working there must be possibility to
>> create loopback devices with different names.
>>
>> The easiest way to acomplish this seems to be with this patch below.
>>
>> I know the devices will be seen in each namespace, but sometimes
>> the only thing that is needed is network environment separation.
>> For example when I need to run two different services on the same TCP
>> port
>> bound to 0.0.0.0.
>>
>> This patch will not break anything and allow people to test
>> net namespace functionality.
>>     
I don't think you have to patch anything if you try a kernel >= 2.6.29.
The sysfs restriction has been solved by disabling the registering of 
the kobject when we are not in the initial network namespace.

For more information you can check this commit:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=commit;h=3891845e1ef6e6807075d4241966b26f6ecb0a5c

Regards,
  -- Daniel