Instale o pacote uml-utilities
:
sudo apt install uml-utilities
Crie uma interface de loopback:
sudo tunctl
Exemplo de saída:
Set 'tap0' persistent and owned by uid 0
Chame a interface tap0
:
sudo ifconfig tap0 up
Para remover o tap0
run: tunctl -d tap0
Para atribuir um endereço IP:
sudo ifconfig tap0 192.168.0.254 up
Exemplo de saída:
tap0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.0.254 netmask 255.255.255.0 broadcast 192.168.0.255
ether ce:bd:dd:0f:08:c8 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
e, g 2:
$ sudo ifconfig tap0 127.0.0.1 up
tap0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255