Configurando Interfaces virtuais (alias) usando iproute2 no linux

Vamos visualizar as interfaces disponíveis na máquina.

ip addr show

julio@julio:~$ ip addr show  
3: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether a4:1f:72:f5:81:1f brd ff:ff:ff:ff:ff:ff
inet 192.168.1.11/24 scope global enp4s0
valid_lft forever preferred_lft forever

Vamos criar a interface com o ip e subir .

julio@julio:~$ sudo ip addr add 10.1.1.246/24 dev enp4s0 label enp4s0:virtual 
julio@julio:~$ sudo ip link set enp4s0:virtual up

Verificando.

ip addr show

julio@julio:~$ ip addr show
3: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether a4:1f:72:f5:81:1f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.11/24 scope global enp4s0
       valid_lft forever preferred_lft forever
    inet 10.1.1.246/24 scope global enp4s0:virtual
       valid_lft forever preferred_lft forever
    inet6 fe80::a61f:72ff:fef5:811f/64 scope link 
       valid_lft forever preferred_lft forever

Deixe uma resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *