-1

If I connect a device via ethernet onto a switch, and do not receive an IP address via DHCP, how do I determine what the correct settings for that network should be, i.e. how do I choose a static IP address, subnet mask and gateway?

The specifics in my case are that I have an NVR with an 8 port POE switch that has 3 cameras plugged into it. I plugged my Windows 10 PC into the switch, expecting to be issued an IP address from the NVR via DHCP, but my PC was not given an IP. Perhaps the NVR assigns IPs via BOOTP? I want to get onto the network, probably by assigning a static IP that's not already used, then determine the IPs of the cameras so I can stream video from them directly using VLC.

Can I use tcpdump? There should be plenty of traffic from the cameras to the NVR.

red0ct
  • 4,840
  • 3
  • 17
  • 44
Mike
  • 312
  • 3
  • 13
  • 1
    Perhaps the question is a bit broad and is more appropriate to [Network Engineering SE](https://networkengineering.stackexchange.com/). Also it's a very strange situation that you want to access absolutely unknown network. It looks like information security issue, in this case you can go to [Information Security SE](https://security.stackexchange.com/) – red0ct May 17 '20 at 16:37
  • It can't be that strange. I'm describing a real-world problem I'm having with a vanilla COTS picked up from Amazon. Wouldn't anyone connecting to a network without DHCP have the same problem? Regardless, I take your point and have posted instead to ISSE. – Mike May 19 '20 at 02:29

1 Answers1

0

how do I choose a static IP address, subnet mask and gateway?

The short answer - this should be done by your network administrator. If you are the network administrator - you should. But seems that you are connecting to the network you know nothing about.. Anyway here are some points that perhaps can help you.

There is a special thing called ARP Duplicate Address Detection (DAD). In Linux you can check if the particular IP is occupied in your broadcast segment with help of arping utility. From MAN page:

-D
    Duplicate address detection mode (DAD). See RFC2131, 4.4.1.
    Returns 0, if DAD succeeded i.e. no replies are received.

So if IP address is occupied you will see something like:

-bash-4.4# arping -D 10.0.99.99 -I eth0
ARPING 10.0.99.99 from 0.0.0.0 eth0
Unicast reply from 10.0.99.99 [DE:AD:BE:EF:00:8D]  1.274ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)

If this IP address is vacant, you'll see no responses. Read about ARP ping in Windows.

Also you can inspect the network through the tcpdump (to see some IP addressing info at least in broadcast packets), nmap and some other scanning utilities, but this topic is too broad (and at the same time it's well disclosed on the Internet). Btw you have to consider network architecture difficulties: vlan and so on.

red0ct
  • 4,840
  • 3
  • 17
  • 44
  • arping sounds useful for selecting a unique static IP on a network with a known configuration. In this case I don't know anything about the network in question, so I'd have to cast about in reserved subnets like 192.168.0.0/16 or 10.0.0.0/8 until I find an IP that's used. nmap looks useful, I'll check that out. Thanks! – Mike May 19 '20 at 02:27
  • @Mike You can analyze traffic dump to see some broadcast packets, so you can a bit predict IP addressing, try to assign an address and do some network inspection. – red0ct May 19 '20 at 09:00