Route command help (windows)

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,815
Reaction score
8,424
Location
USA, Oregon
I wanted to access a camera at its default address of 192.168.1.108. It's for sure online as the Dahua config tool finds it at that address. I typed the following route command:

route add 192.168.1.0 mask 255.255.255.0 0.0.0.0

The routing table looks right to me:
routeTable.JPG
No response from the camera with the web browser and no response on a ping. Config tool still finds it. 192.168.100.103 is the computer's IP address. What am I doing wrong?
 

SouthernYankee

IPCT Contributor
Joined
Feb 15, 2018
Messages
5,170
Reaction score
5,320
Location
Houston Tx
to access the dahua camera
use SmartPSS
or set the IP address on you PC static to the 192.168.1.xxx subnet, then login to the camera using a browser. Use internet explorer or PaleMoon 32. You can use chrome to change the configurations but not view the video (chrome security) . change the camera IP address to your home submet.

do not know about using the routing table, most of the time the firewall will block local IPS that are not on the same subnet.
 

sebastiantombs

Known around here
Joined
Dec 28, 2019
Messages
11,511
Reaction score
27,690
Location
New Jersey
My trick is to use a static IP for the BI machine and add 192.168.1.xxx in advanced properties for the IPV4 configuration settings. No problems reaching a new camera that way.
 
Last edited:

jimbo123

Young grasshopper
Joined
Mar 15, 2019
Messages
65
Reaction score
11
Location
Australia
Looks like you've told your computer how to reach your camera, if you're going to leave the addresses as is, then your camera needs the same the other way.

You could either do what ST suggests, or re-address your computer temporarily as SY suggests to be something on the same network segment as your camera, e.g. 192.168.1.100, to gain access then do any reconfig required before putting it back.
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,815
Reaction score
8,424
Location
USA, Oregon
I should have stated that I'm not having a camera problem, and can access it with the Dahua Config Tool no matter what IP address it's configured with. This is a learning exercise for me. I thought that with the correct route command I'd be able to talk to the camera on a different subnet on the same physical lan. The Config Tool does it, so why can't I connect to it any other way?
 

Hammerhead786

Pulling my weight
Joined
Apr 23, 2018
Messages
248
Reaction score
165
How is everything connected? Do you have a network diagram of your setup? Have you tried a subnet mask of 255.255.0.0?
 
Last edited:

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,815
Reaction score
8,424
Location
USA, Oregon
How is everything connected? Do you have a network diagram of your setup? Have you tried a subnet mask of 255.255.0.0?
You nailed it! Changed the mask in the camera to 255.255.0.0 and I can ping the camera and log into its web UI. It's late and I don't have a clue right now why this worked. Will try to figure that out tomorrow. No sure I'd ever have figured it out by myself. The network is ultra simple: Router built into the ISP modem, connected to a switch, and everything else connected to the same switch. The bonus question was if the Dahua single-NIC NVR would connect to the camera. It won't, so it looks like the cameras have to be on the same subnet as the NVR. Thanks again, this info was exactly what I was looking for.
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,815
Reaction score
8,424
Location
USA, Oregon
After years of confusion I think I finally understand this little part of networking. The combination of a device's IP address, the mask, and the destination IP address determines if an outgoing packet is sent directly to the destination IP, or to the gateway.

When the settings were camera ip = 192.168.1.108, mask 255.255.255.0, and destination ip = 192.168.100.103 (the PC's IP address), the camera compared 192.168.1.x with 192.168.100.x, found the mismatch, and sent the outgoing packet to the gateway. When changing the mask to 255.255.0.0, the camera compares 192.168.x.x with 192.168.x.x, finds a match, and sends the packet directly to the destination.

Once realizing this, I changed the NVR's gateway to 255.255.0.0, and it now connects to the camera at 192.168.1.108. At first glance I want to say that 192.168.1.x and 192.168.100.x are separate subnets, but in reality it's a single subnet with 65,536 addresses instead of the 256 addresses in the subnets we usually work with. But since nothing can be that simple, the PC sees it as two subnets managed by its built in routing capability.

Hope I've got it right finally. It does seem to make sense now.
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
You're on the right track but sound confused. First off, you shouldn't be using a /16 network that's poor design. Is your PC using a /16 subnet mask?

You shouldn't need to do anything with routing in the PC assuming your devices and router are configured correctly. With a /24 subnet mask and the PC on the 192.168.100.0 /24 network anything between it and 192.168.100.0-255 doesn't even require a gateway to communicate. You could plug them in to a dumb switch, or just 2 devices together and they would communicate just fine. Anything OUTSIDE that range requires a gateway which your PC needs to know what that gateway is (usually .1).

A /16 is a HUGE broadcast domain. While you may get away with it in a home because you only have a few devices it's still poor design. I would fix the design, and set up your /24 subnets and establish whatever routing you require between the subnets.

Sent from my SM-G965U using Tapatalk
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,815
Reaction score
8,424
Location
USA, Oregon
Did you notice in post #5 that this was a learning exercise? Thanks to a post that addressed the original question, it was successful. Has nothing to do with the design of the network.
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
Did you notice in post #5 that this was a learning exercise? Thanks to a post that addressed the original question, it was successful. Has nothing to do with the design of the network.
No I missed that. Either way if the devices were configured properly and your gateway (router) is configured properly the router should have taken care of the routing between subnets. By using a /16 you're not communicating between subnets. You're using one single huge subnet instead.

Sent from my SM-G965U using Tapatalk
 

IAmATeaf

Known around here
Joined
Jan 13, 2019
Messages
3,287
Reaction score
3,252
Location
United Kingdom
No I missed that. Either way if the devices were configured properly and your gateway (router) is configured properly the router should have taken care of the routing between subnets. By using a /16 you're not communicating between subnets. You're using one single huge subnet instead.

Sent from my SM-G965U using Tapatalk
Unless he has a physical or software router in place he won’t be able to route. Most people here when they refer to router mean the box that provides access to their internet via their ISP.

You can use the command route add to add a route to differing subjects but the destination would normally be a routing device which would act as an intermediary between the subnets.

I don’t know the capabilities of all ISP routers but I’ve never come across one that can act as a router to route between differing subnets. Yes in some you can add a static route but again the destination would need to be physical or software routing device.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,930
Reaction score
6,778
Location
Scotland
Either way if the devices were configured properly and your gateway (router) is configured properly the router should have taken care of the routing between subnets.
That does not occur by default.
It would require a static route to have been manually added to the router configuration such that the additional local segment exists in its routing table along with the gateway that connects to it.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,930
Reaction score
6,778
Location
Scotland
I don’t know the capabilities of all ISP routers but I’ve never come across one that can route between differing subnets.
It's generally possible to add a static route.
Though I have seen some ISP routers that don't have that ability. Such as the EE hub I'm currently using ...
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
That does not occur by default.
It would require a static route to have been manually added to the router configuration such that the additional local segment exists in its routing table along with the gateway that connects to it.
Hence I said "if configured properly".

Creating one big /16 network isn't the answer that's for sure. However I missed that this was "training". Even more so I would think the OP would be better off understanding subnetting and learning how to establish routing in his router.

Sent from my SM-G965U using Tapatalk
 

tigerwillow1

Known around here
Joined
Jul 18, 2016
Messages
3,815
Reaction score
8,424
Location
USA, Oregon
As an FYI that has nothing to do with my original purpose of learning the route command, what I may or may not know about subnetting means nothing in my situation. My router is supplied by the ISP and its configuration is inaccessible to me. It supplies DHCP addresses and provides a WAN connection to whatever I plug into it. Nothing more is available. Although it's an unusual situation, a few others on the forum have reported being in the same boat. I run a 28 port switch behind the router, and it does have some level 3 capability. I have the option with the current ISP of paying more monthly for which they will run their device in bridge mode and I can put my own router behind it, or I can change to the only other ISP available to me for a ~$200 upfront installation charge. I'm currently not liking either of those options.
 
Top