4

I would like to add a second loopback network device on Linux, so that I have lo and (e.g.) lo2. This is so that I can use netem to simulate a throttled network over lo2 without compromising my standard loopback interface.

Note that I can not use an alias interface here (such as lo:1) since netem will affect the underlying (lo) interface, not the interface alias.

How can that be done?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Paul Cager
  • 143
  • 4

2 Answers2

5

Can you add a virtual tap device and do the testing on that?

ip tuntap add dev tap0 mode tap

You may need to insert the tun module first.

modprobe tun
Matt
  • 8,841
  • 1
  • 26
  • 32
0

Can't do. The net 127.0.0.0/8 is always loopback (127.0.0.1 is just conventional). This is enforced by the kernel.

vonbrand
  • 18,156
  • 2
  • 37
  • 59