Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Terminal do MacOS não exibe máscara de rede e default gateway usando o ifconfig

Boa noite! Não sei se esta dúvida faz parte do escopo deste curso, caso não seja pode desconsiderar.

Quando dou o comando ifconfig no terminal do Mac, no inet aparece apenas o ip host e o ip da máquina, mas não aparecem as outras informações como máscara de rede e default gateway. Sabe me dizer o porquê disto ocorrer e se é possível eu alterar a configuração para aparecer? Exemplo:

MacBook:~ thabataoliveira$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 78:4f:43:78:5e:e0 
    inet6 fe80::8d1:1d78:892:1eeb%en0 prefixlen 64 secured scopeid 0x5 
    inet 192.168.0.108 netmask 0xffffff00 broadcast 192.168.0.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether d2:00:b9:10:69:00 
    media: autoselect <full-duplex>
    status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether d2:00:b9:10:69:04 
    media: autoselect <full-duplex>
    status: inactive
en3: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether d2:00:b9:10:69:01 
    media: autoselect <full-duplex>
    status: inactive
en4: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether d2:00:b9:10:69:05 
    media: autoselect <full-duplex>
    status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether d2:00:b9:10:69:00 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    member: en2 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 7 priority 0 path cost 0
    member: en3 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 8 priority 0 path cost 0
    member: en4 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 9 priority 0 path cost 0
    nd6 options=201<PERFORMNUD,DAD>
    media: <unknown type>
    status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether 0a:4f:43:78:5e:e0 
    media: autoselect
    status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
    ether 86:42:6d:f0:40:33 
    inet6 fe80::8442:6dff:fef0:4033%awdl0 prefixlen 64 scopeid 0xc 
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
    inet6 fe80::f196:daca:e932:dbdb%utun0 prefixlen 64 scopeid 0xd 
    nd6 options=201<PERFORMNUD,DAD>
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether ac:de:48:00:11:22 
    inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x4 
    nd6 options=281<PERFORMNUD,INSECURE,DAD>
    media: autoselect
    status: active

Obrigada.

1 resposta
solução!

Olá, o ifconfig mostra sim a mascara de rede, você só não percebeu que está num formato hexadecimal, tá lá escrito "netmask 0xffffff00" isso significa 255.255.255.0

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 78:4f:43:78:5e:e0 
    inet6 fe80::8d1:1d78:892:1eeb%en0 prefixlen 64 secured scopeid 0x5 
    inet 192.168.0.108 netmask 0xffffff00 <-----OLHA EU AQUI broadcast 192.168.0.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active

Já o default gateway, PROVAVELMENTE, considerando seu IP e sua netmask, deve ser 192.168.0.1 mas pode confirmar com o seguinte comando

netstat -r

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.15.1       UGSc           28        0     en1