Skip to content
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

netmask is returning None #60

Open
farp80 opened this issue Feb 20, 2021 · 6 comments
Open

netmask is returning None #60

farp80 opened this issue Feb 20, 2021 · 6 comments

Comments

@farp80
Copy link

farp80 commented Feb 20, 2021

I am trying to get IP/subnet using the code in this repo, but I am getting NOne as result in the Netmask, even though I can confirm the subnet mask through cmd.
this is the response:

{
  'Ethernet adapter Ethernet 2': {
    'inet': None,
    'inet4': [
      
    ],
    'ether': 'e8:6a:64:3f:e5:c3',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'ethernet adapter ethernet 2'
  },
  'Ethernet adapter VirtualBox Host-Only Network': {
    'inet': '192.168.56.1',
    'inet4': [
      '192.168.56.1'
    ],
    'ether': '0a:00:27:00:00:15',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'ethernet adapter virtualbox host-only network',
    'hostname': 'fidel-desktop'
  },
  'Ethernet adapter Ethernet 3': {
    'inet': '192.168.1.15',
    'inet4': [
      '192.168.1.15'
    ],
    'ether': '94:05:bb:12:19:db',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'ethernet adapter ethernet 3',
    'hostname': 'fidel-desktop'
  },
  'Wireless LAN adapter Local Area Connection* 3': {
    'inet': None,
    'inet4': [
      
    ],
    'ether': '18:56:80:2e:1d:0b',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'wireless lan adapter local area connection* 3'
  },
  'Wireless LAN adapter Local Area Connection* 4': {
    'inet': None,
    'inet4': [
      
    ],
    'ether': '1a:56:80:2e:1d:0a',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'wireless lan adapter local area connection* 4'
  },
  'Ethernet adapter Bluetooth Network Connection 2': {
    'inet': None,
    'inet4': [
      
    ],
    'ether': '18:56:80:2e:1d:0e',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'ethernet adapter bluetooth network connection 2'
  },
  'Wireless LAN adapter Wi-Fi 2': {
    'inet': None,
    'inet4': [
      
    ],
    'ether': '18:56:80:2e:1d:0a',
    'inet6': [
      
    ],
    'netmask': None,
    'device': 'wireless lan adapter wi-fi 2'
  }
}
@benjaoming
Copy link
Collaborator

Hi @farp80

Could you format your code in a readable way and perhaps provide details such as your operating system and the outputs of the "cmd" that you are talking about?

@farp80
Copy link
Author

farp80 commented Feb 22, 2021

ifcfg.txt
Hi.
This is what I did:

  1. I imported ifcfg and then access its method to get my interface's settings.
    [NOTE]: I am using Windows 10. I did the ipconfig/all.

Attached is the file (formatted) with the ifcfg's response.

I think you can verify my doubts if you run it in a Windows environment.

Thanks.

@jonboiser
Copy link
Collaborator

I edited the original post. The formatting was off because the whole output was wrapped in a single backtick.

@farp80
Copy link
Author

farp80 commented Feb 22, 2021

@jonboiser : thanks. I just clicked the insert code icon.

@benjaoming
Copy link
Collaborator

@farp80 for someone to work on the issue, they will likely need the output of when you run the ipconfig /all command. Could you contribute that?

@arpitsaigal
Copy link

Could this be because there is no pattern for 'Subnet Mask' in the get_patterns() method in the Windows parser?

@classmethod
def get_patterns(cls):
    return [
        r"^(?P<device>\w.+):",
        r"^   Physical Address. . . . . . . . . : (?P<ether>[ABCDEFabcdef\d-]+)",
        r"^   IPv4 Address. . . . . . . . . . . : (?P<inet4>[^\s\(]+)",
        r"^   IPv6 Address. . . . . . . . . . . : (?P<inet6>[ABCDEFabcdef\d\:\%]+)",
        r"^\s+Default Gateway . . . . . . . . . : (?P<default_gateway>[^\s\(]+)",
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants