0

I am taking an internet (CISCO) course and don't understand the difference between the default gateway address for a router and its IP address. In every example of the class the default gateway address is 192.168.1.x, often x is 1. In my home system the router default gateway is 192.168.1.1. Therefore the IP address of the router and its default gateway are the same. In a class example I am to create a home network with a number of different hosts and assign IP addresses for each of them. The default gateway of the router is given as 209.165.200.226. So, I have to believe the desired network address for the home network is 209.165.200.0 and therefore all of the hosts on this network should follow as 209.165.200.2 - x. The default gateway address of a host is the router so how can a router have a default gateway address unless it is itself.

Second, I have never seen an example of a switch with an IP address. Do I have to assign an IP address to a switch. I assume not.

If multiple hosts are tied directly to a router, must I change the network address for each connection?

Stuggi
  • 2,269
  • 1
  • 13
  • 33
RobB
  • 1
  • Routers do not have default gateways, routers that have routing enabled can use default routes. The network hosts have a default gateway, and it is the router address on that network. Switches only have IP addresses for the management of the switch. – Ron Maupin Apr 26 '20 at 01:07
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer. – Ron Maupin Dec 17 '20 at 17:01

1 Answers1

2

the difference between the default gateway address for a router and its IP address

Network nodes (often) use a default gateway. Routers may have a default route. A gateway is a router that allows you to pass traffic to a network that is remote to you.

A router's IP address may be set up as default gateway for the other network nodes. That means that router is used as a gateway to any other network.

The default gateway of the router is given as 209.165.200.226. So, I have to believe the desired network address for the home network is 209.165.200.0

That depends on the network mask or prefix length that is being used. Your assumption is based on a /24 prefix which may or may not be the case. Also, your router's default gateway is usually located on another network (see below), not on your local network, so your assumption is most likely wrong.

See this excellent Q&A for how network masks and prefixes work.

The default gateway address of a host is the router so how can a router have a default gateway address unless it is itself.

Routing needs to be done on a hop-to-hop basis. Usually, all nodes in a given network use a common default gateway for outbound traffic. That gateway/router is connected to multiple networks. Its routing table contains the routes to the directly connected networks and to other, remote networks that are in turn connected to other routers/gateways it can talk to (because it shares a network with them).

In a very simple scenario, a router has only two networks connected: your LAN and a link its own default gateway points to. However, a router can have more than two interfaces and it can see a number of other gateways. Accordingly, it can have a much larger number of choices when making forwarding decisions.

Zac67
  • 84,333
  • 4
  • 69
  • 133
  • First, the mask is /24 and I understand that very well. The intended network is a home network and I should have used a private IP address but the 209.165.200.266 address confused me. So if I set the network address to be 192.168.1.0 and the IP address of the router to be 192.168.1.1 then the gateway address for the router must be in another device? – Rob B. Apr 26 '20 at 12:36
  • As Zac67 says, routers don’t have default gateways, they have default routes. The next hop address in this case is the ISP router. – Ron Trunk Apr 26 '20 at 13:10
  • @RobB.Home networking is off-topic here, and you will not have a private LAN with 209.165.200.266 in it. Likely, that's your router's public IP on its WAN interface. The private LAN has some addressing from RFC 1918. then the gateway address for the router must be in another device? Yes, that's the point of having a routing table entry on a router. – Zac67 Apr 26 '20 at 13:15
  • FYI - the home network is an example from a CISCO networking class. I am not setting up a home network only trying to understand the concepts. – Rob B. Apr 26 '20 at 13:35