feross / spoof

Easily spoof your MAC address in macOS, Windows, & Linux!
https://feross.org/spoofmac/
MIT License
1.78k stars 99 forks source link

`ifconfig` output is inconsistent across distros #15

Closed nathanph closed 6 years ago

nathanph commented 7 years ago

I think you should be using the newer ip command as ifconfig is not only deprecated, but also inconsistent across linux distros.

E.g., my output is incompatible with spoof (Ubuntu 16.10):

br-aaaf777a4e49: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 02:42:0b:29:dd:90  txqueuelen 0  (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

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 02:42:9b:59:49:b4  txqueuelen 0  (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

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 188143  bytes 11719536 (11.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 188143  bytes 11719536 (11.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.69  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::b60f:1f73:168b:9d98  prefixlen 64  scopeid 0x20<link>
        ether 60:6d:c7:c6:25:cb  txqueuelen 1000  (Ethernet)
        RX packets 53917  bytes 35312965 (35.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47734  bytes 11155012 (11.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I'll make the necessary changes if you're willing to accept the move from ipconfig to ip.

feross commented 7 years ago

I'll accept the change to ip if you send a PR! 👍

boydthomson commented 7 years ago

I'm running Ubuntu 17.04 and spoof isn't working for me. Output from spoof-list is null, but ifconfig shows my interfaces correctly. I'm new to JS and Node, and this would be my first PR, but I'm looking into it...

gkashikar commented 6 years ago

I see the same issue as seen by boydthomson only for Ubuntu 17.10 output from spoof list is null and ifconfig does shows all my interfaces correctly. Any fix for this Feross?

feross commented 6 years ago

I don't have any immediate plans to work on this issue, so I'm going to close it. If you (or anyone else) wants to tackle it, I'll happily accept a PR!