Network¶
This documentation provides details about the data that can be faked for Networks.
To retrieve generated/fake data for Networks see the following capabilities:
from socfaker import SocFaker
sc = SocFaker()
print(sc.network.ipv4)
print(sc.network.ipv6)
print(sc.network.get_cidr_range('192.168.1.0/24'))
print(sc.network.hostname)
print(sc.network.netbios)
print(sc.network.port)
print(sc.network.protocol)
Network Class¶
-
class
socfaker.network.
Network
¶ The Network class contains properties related to networking
- Returns:
- Network: Returns an object with properties related to network information
-
get_cidr_range
(cidr)¶ Returns an IPv4 range
- Returns:
- str: Returns CIDR range for an IPv4 address.
-
ipv4
¶ Returns an IPv4 IP Address
- Returns:
- str: Returns an IPv4 Address.
-
ipv6
¶ Returns an IPv6 IP Address
- Returns:
- str: Returns a IPv6 Address.
-
netbios
¶ Returns a netbios name
- Returns:
- str: Returns a random netbios name
-
port
¶ Returns a dictionary map of a port and it’s common name
- Returns:
- dict: A random port and it’s common name
-
private_ipv4
¶ Returns an IPv4 IP Address
- Returns:
- str: Returns an IPv4 Address that will be 10.x.x.x or 172.x.x.x or 192.168.x.x.
-
protocol
¶ Random network protocol
- Returns:
- dict: Returns a random network protocol and protocol number