-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong NetMask shown for IP #26
Comments
Right... I just took a look at the code and the command that is executed to grab the netmask for ifconfig "eth0" 2> /dev/null | egrep 'netmask|Mask:' | awk '{print $4}' | sed 's/Mask://'
255.255.0.0 Well, in this case ifconfig eth0
eth0 Link encap:Ethernet HWaddr 5C:F8:21:0F:40:D8
inet addr:169.254.123.48 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7177 errors:0 dropped:122 overruns:0 frame:0
TX packets:8245 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1095587 (1.0 MiB) TX bytes:4655128 (4.4 MiB)
Interrupt:33 Using |
@nsgundy What's the actual output you're getting from |
The array returned by [ { name: 'eth0',
ip_address: '192.168.2.116',
mac_address: '5c:f8:21:0f:40:d8',
gateway_ip: '192.168.2.1',
netmask: '255.255.0.0',
type: 'Wired' } ] So far, from what I have observed, |
Ok, I'll take a look at this later. Thanks for the heads up! |
Node: 6.9.1
network: 0.4.0
I have this situation where
eth0
has two IP addresses (one assigned by DHCP and the other is a link-local address assigned bysystemd-networkd
), butget_interfaces_list()
returns the IP of the DHCP address with the netmask of the link-local address.Output from
os.networkInterfaces()
Output from
ip -o -4 addr show eth0
:This also poses the question: How can I grab a specific IP address for an interface using network? In my application for example, I am interested in the
scope global
address when available, otherwise in thescope local
address.The text was updated successfully, but these errors were encountered: