If the router IP address were something else instead of 192.168.1.1, how would I find out what it is?
Assuming some flavour of Linux:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
(note on some flavours like Debian, route is not in $PATH for a non-root user, and you may have to use
/sbin/route, or you can invoke
netstat -rn for the same info)
In most common home cases, the router will be listed as the gateway for 0.0.0.0- in this made-up example
If you want to find out more about the meaning of the output of route, see the question over on unix.se:
Understanding the output of route -n
Shouldn't ifconfig give me the IP address of the router?
ifconfig does not show gateway information - use 'route' to view or manipulate routing info.