View previous topic :: View next topic |
Author |
Message |
Chili0_ n00b
Joined: 09 Oct 2017 Posts: 71
|
Posted: Thu Dec 09, 2021 2:01 am Post subject: [Solved] How to add another loop device? |
|
|
Hi,
According https://askubuntu.com/questions/444124/how-to-add-a-loopback-interface, I have successfully created a new loop device.
Code: | lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2014825 bytes 1031007005 (983.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2014825 bytes 1031007005 (983.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo:0: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.2 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback) |
To make the new loop device auto generated, I created a net.lo0 in /etc/init.d/ with ln -s net.lo net.lo0 , in /etc/conf.d/net, I have Quote: | config_lo0="127.0.0.2 netmask 255.0.0.0" | , but I got following errors while running /etc/init.d/net.lo0 restart
Code: | $ sudo /etc/init.d/net.lo0 restart
Password:
* Bringing up interface lo0
* ERROR: interface lo0 does not exist
* Ensure that you have loaded the correct kernel module for your hardware
* ERROR: net.lo0 failed to start |
Any advice?
Thanks. _________________ Regards.
Last edited by Chili0_ on Thu Dec 09, 2021 2:50 am; edited 3 times in total |
|
Back to top |
|
|
Chili0_ n00b
Joined: 09 Oct 2017 Posts: 71
|
Posted: Thu Dec 09, 2021 2:43 am Post subject: |
|
|
Frist: kernel should support dummy driver in Devices drivers -> Net driver support -> dummy
Code: | # ip link add name type dummy |
Then in /etc/conf.d/net
Code: |
### Add one more loop device for dnscrypt-proxy
config_loop0="127.0.0.3 netmask 255.0.0.0"
|
Finally,
Code: | /etc/init.d/net.loop0 start |
_________________ Regards. |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30915 Location: here
|
Posted: Thu Dec 09, 2021 9:18 am Post subject: |
|
|
Moved from Other Things Gentoo to Networking & Security. _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
Chili0_ n00b
Joined: 09 Oct 2017 Posts: 71
|
Posted: Tue Dec 14, 2021 6:16 am Post subject: |
|
|
UberLord wrote: | Code: | lo:0: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 |
No, that's an aliased address to the lo interface.
It's not a new loopback device.
But that's probably what you want, it doesn't make sense to have more than one loopback interface.
Anyway, on Linux the preferred command is `ip a` which will show this in more clarity. |
Thanks, now I understand. _________________ Regards. |
|
Back to top |
|
|
dimko Apprentice
Joined: 12 Feb 2006 Posts: 196
|
Posted: Thu Feb 10, 2022 11:44 pm Post subject: Could I ask |
|
|
Why loop device?
Would TAP/TAN device not satisfy? _________________ Just a user. |
|
Back to top |
|
|
|