Como adicionar um alias à nossa interface com IP estático

1

Eu estou trabalhando no Ubuntu 16.04 LTS. Eu preciso de docker xdebug adicionar um alias à nossa interface com IP estático. Eu descubro o comando no manual que eu deveria executar

sudo ip addr add 10.254.254.254/24 brd + dev eth0 label eth0:1

mas eu tenho erro

Cannot find device "eth0" I didn't know what the device I should use. I connect to the enternet via Wifi ifconfig give me the next result.

br-3ef36763ff4a Link encap:Ethernet  HWaddr 02:42:95:4f:d5:21  
          inet addr:172.20.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:95ff:fe4f:d521/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:285651 errors:0 dropped:0 overruns:0 frame:0
          TX packets:271008 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:921587988 (921.5 MB)  TX bytes:90682342 (90.6 MB)

br-68b224e12893 Link encap:Ethernet  HWaddr 02:42:e8:d9:24:fc  
          inet addr:172.21.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:e8ff:fed9:24fc/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:8330 (8.3 KB)

br-7de25c598e22 Link encap:Ethernet  HWaddr 02:42:8b:bc:25:72  
          inet addr:172.18.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:8bff:febc:2572/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:445 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2673 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:923525 (923.5 KB)  TX bytes:364192 (364.1 KB)

br-ea4e25d8ecec Link encap:Ethernet  HWaddr 02:42:13:41:80:08  
          inet addr:172.19.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

docker0   Link encap:Ethernet  HWaddr 02:42:3b:69:41:39  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:3bff:fe69:4139/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:12526 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21097 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:720825 (720.8 KB)  TX bytes:30520576 (30.5 MB)

enp5s0f1  Link encap:Ethernet  HWaddr 78:24:af:c8:e1:ef  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:393173 errors:0 dropped:0 overruns:0 frame:0
          TX packets:237329 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:592966216 (592.9 MB)  TX bytes:16696636 (16.6 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:92046 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92046 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:850278889 (850.2 MB)  TX bytes:850278889 (850.2 MB)

veth5053565 Link encap:Ethernet  HWaddr f2:85:65:0e:e6:f8  
          inet6 addr: fe80::f085:65ff:fe0e:e6f8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5154 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5462 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:71662571 (71.6 MB)  TX bytes:528330 (528.3 KB)

veth33345b7 Link encap:Ethernet  HWaddr fe:15:f6:de:7f:1e  
          inet6 addr: fe80::fc15:f6ff:fede:7f1e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3646 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2719 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:44261915 (44.2 MB)  TX bytes:43869439 (43.8 MB)

vethc1c7bd6 Link encap:Ethernet  HWaddr 0e:75:6d:c4:8e:1a  
          inet6 addr: fe80::c75:6dff:fec4:8e1a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6367 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5782 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:44248850 (44.2 MB)  TX bytes:71727816 (71.7 MB)

vethf6abb7f Link encap:Ethernet  HWaddr 12:4f:c3:8a:1c:7d  
          inet6 addr: fe80::104f:c3ff:fe8a:1c7d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:133 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:894 (894.0 B)  TX bytes:16602 (16.6 KB)

wlp4s0    Link encap:Ethernet  HWaddr 40:e2:30:70:5a:e1  
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::460b:a17d:e48b:2461/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2030711 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1347090 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2881848123 (2.8 GB)  TX bytes:148307685 (148.3 MB)

wlp4s0:1  Link encap:Ethernet  HWaddr 40:e2:30:70:5a:e1  
          inet addr:10.254.254.254  Bcast:10.254.254.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
    
por Rider_BY 09.09.2017 / 17:27

1 resposta

2

ip addr add não pode criar novos dispositivos (e isso provavelmente não foi sua intenção). Portanto, primeiro você precisa descobrir para qual dispositivo existente deseja adicionar um alias e, em seguida, usar seu nome em vez de eth0 .

    
por 09.09.2017 / 17:55