cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
23581
Views
0
Helpful
4
Replies

Why assign IP addresses to router/switch interfaces?

turbow5PCgamer
Level 1
Level 1

I get why I would ever want to assign a IP address to a router or switch, for remote login and IP for hosts to reach it. But why assign IP addresses to the interfaces? Is it so the router/switch knows which port to send the packet out? Route summation? But I thought they do that through the routing table, like " that address is out this port".

So why would we ever need to assign IP addresses to specific port interfaces?

1 Accepted Solution

Accepted Solutions

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

Correct.  Remember, when host A makes packet, packet's destination is destination host, and doesn't change as packet hops across links.  However, frame destination MAC change, packets transits each link.  So each links IPs, and MACs, are use for "what's the next transit interface".

If you do a traceroute, to a destination, you'll see the "next hop" IPs. (I.e. the L3 interface IP you're ingressing on.)

View solution in original post

4 Replies 4

brett.harding
Level 1
Level 1

Yes you would assign an IP address for management and remote access but you may also assign an IP address to a switch port if you wanted the switch to route IP traffic, or participate in your routing domain. Many switches have the "ip routing" feature disabled by default which means they cannot route traffic. If the switch is being used at layer 2 only, then an IP address is not required and the switch will "bridge" traffic based on MAC address rather IP address.

 

 

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

You normally assign IP addresses to L3 interfaces so other L3 devices have an IP address to forward traffic to.  (L2 IP address are generally only used for management.)

Suppose you had Host (192.168.1.5/24) <> R1 <> R2 <> (192.168.2.8/24) Host, and you want the two hosts to intercommunicate.  How would you get this to work?

You might started by providing interface IPs on the router interfaces facing the host, such as:

Host (192.168.1.5/24) <> (192.168.1.1/24) R1 <> R2 (192.168.2.1/24) <> (192.168.2.8/24) Host

You then configure "gateway" IPs on both hosts:

Host (192.168.1.5/24 - GW 192.168.1.1) <> (192.168.1.1/24) R1 <> R2 (192.168.2.1/24) <> (192.168.2.8/24 - GW 192.168.2.1) Host

Now each hosts "knows" to send all its off local subnet, traffic physically to the GW IP.  So, for example, if 192.168.1.5 want to sent to 192.168.2.8, it would forward the traffic to the GW IP, 192.168.1.1.  This is a example of why you want an IP on the router's L3 interface.

Next we want R1 to forward the packet to R2, but it too needs a "next hop" IP address, so we assign addresses on the link between the two router, e.g.:

Host (192.168.1.5/24 - GW 192.168.1.1) <> (192.168.1.1/24) R1 (192.168.3.1/24) <> (192.168.3.2/24) R2 (192.168.2.1/24) <> (192.168.2.8/24 - GW 192.168.2.1) Host

R1 then needs to "know" where to send packets with an destination IP network of 192.168.2.0/24, in this case, it need to "know" to send the to IP 192.168.3.2.  When it does, R2, having and interface with 192.168.2.1, will also know 192.168.2.8 can be reached by sending the packet out that interface.

Hopefully, the above will show why IP addresses on router L3 interfaces are needed.

BTW, normally for the R1<>R2 link, you would assign a /30 or /31 network or you might use "unnumbered" interfaces (which "borrow" IPs from another interface).

Ok, so it's just for routing the traffic. So let me see if I have this correct in my example.

 

Host A (192.168.1.10) [GW 192.168.1.1] makes a packet to send to router 1, and to make it go from R1 to R2, it has to have a IP on the line for something like... 192.168.100.0 to reach 192.168.100.1 (which would be the interface of router 2) and repeat the process from R2 to R3 and so on?

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

Correct.  Remember, when host A makes packet, packet's destination is destination host, and doesn't change as packet hops across links.  However, frame destination MAC change, packets transits each link.  So each links IPs, and MACs, are use for "what's the next transit interface".

If you do a traceroute, to a destination, you'll see the "next hop" IPs. (I.e. the L3 interface IP you're ingressing on.)

Review Cisco Networking for a $25 gift card