10 Replies Latest reply: May 14, 2013 11:23 PM by alalam RSS

Why does each interface on a router has an IP address instead of router having only IP address for itself.

This question is bugging me for a while and I am surprised to know people who ought to know these things dont actually know.

So my question is -

Why each interface on a router has an IP address. If we work around, we could devise a system where each router had only one IP address. Is there any historic reason for this? or is it demand of some 'scenario' ? If its because of some scenario, whats that scenario which neccessiates a router to have one IP each interface?

my Second question is - other than one IP for each interface, does a router also has a sepearte IP for itself as a device?

 

PLease answer it.

 

Thanks and regards.

 

Rohit Yadav

  • 1. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    filip.talpa@simac.cz

    if the router only had a single IP address on multiple interfaces it would be called a bridge. Multiple IPs are required for the router function -- connecting two or more IP segements.

    you can use any of the router's IP address as a management address.

  • 2. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    vikramfonseca

    You'd normally have other devices that connect to the interfaces of the router which is why routers have interfaces in the first place. Routers are actually devices that connect different networks and so, the interfaces to which the other devices are connected use that interface as a gateway to get out onto other networks.
    Routers do have an ip address for themself too....this is an IP that is configured on an interface but can be used to connect to the router remotely. It is known as a management IP and is normally the loopback IP.

  • 3. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    ronbuchalski

    Rohit,

     

    There are seval reasons why each interface on a router has an IP address assigned:

     

    1. The router serves as the default gateway on an IP subnet containing host devices.  Therefore, it needs to have an IP address on the subnet so that the hosts on that subnet can communicate with hosts on other subsets.

     

    2. Each link between adjacent routers is a separate IP subset, and so each router needs to have an IP address assigned to it. This IP address is used by the routing protocol for adjacency establishment, source IP of routing advertisements, next-hop information for routes, etc.

     

    3. Links used to interconnect routers can utilize a feature called 'IP unnumbered', where the router uses a IP address configured on another interface as the IP address assigned to the particular interface.  The primary issue with this deals with troubleshooting.  If the interface does not have a unique IP address assigned to the interface, how can you verify connectivity via ping, traceroute, etc?

     

    4. A physical interface on a router can have multiple IP addresses, if needed, by using 'secondary' IP addresses, or by creating sub interfaces on the physical interface.  Again, this is used to provide distinct default gateway addresses for multiple IP subnets connecting to the router on a physical interface, or for a hub-spoke WAN topology.

     

    Regarding an IP address for identifying the router: as others have said, any IP address in the router also identifies the router.  However, a issue with this approach is that the router will use the outbound address closest to the destination as its' source IP, so the source address may change, depending on the destination.  A best practice is to establish a Loopback interface (with a host or /32 IP address) as the Router ID, and configure various services on the router to use this IP address for the source address of packets originated by the router.  An examples, assume that you create interface 'Loopback2' as your router ID.  Then, use the following commands to use this as the source IP address for various services:

     

    - ip tacacs source-interface loopback2

    - ip flow-export source interface loopback2

    - logging source-interface loopback2

    - snmp-server trap-source loopback2

    - ntp source loopback2

    - ip telnet source-interface loopback2

     

    Etc.

     

    Hope this helps.

     

    -rob

  • 4. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    askhuran
    • Every device running TCP/IP has an IP address for the TCP/IP stack. Only the interfaces require an IP address not the devices.
    • So the interface of TCP/IP itself has the LOCALHOST IP address i.e. 127.0.0.1
    • The device would have a connected route with physical interface IP as the next hop
    • The localhost address (127.0.0.1) is not for testing and troubleshooting but for routing the packet from TCP/IP to the physical interface
    • How often did we come across a situation when TCP/IP has failed and we nrequired to test and troubleshoot TCP/IP itself?
    • The TCP/IP stack has no other way to directly learn about the phycial interfaces and their logical addresses
    • The TCP/IP stack has no other way to directly learn whether a physical interface IP address is on the same device or out of it. So the TCP/IP itself has the LOCALHOST IP address i.e. 127.0.0.1 which is home address for itself
    • It requires A CONSTANT ADDRESS AS THE ORIGIN, THE HOME ADDRESS TO INITIALIZE

     

    For the TCP/IP stack, every other address, even the addresses of physical or logical interfaces on the same device are foreign to it.

     

    Experts' opinion please?

  • 5. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    alalam

    Actually you are quite right, you dont need an IP address on an interface. All thats really required is the router be able to resolve the exit interface for a particular destination.  all route is a table with a hop or a hole, once a destination prefix is determined, all the router determines is the exit interface (hole) to que the packet on.

     

    only broadcast, multi access protocols  technologies need to resolve a destination layer 2 address. ie IP uses arp to resolve a destination MAC.

     

    point to point links dont need a destination MAC,  and non broadcast multi access protocols use other technologies like Lane services for ATM. to map destinations to interfaces.

     

    configuration is fairly simple,  search "ip unnumbered"  and the cisco site will kick out dozens of applications

     

    below is a link to one of the technology guides

     

    http://www.cisco.com/image/gif/paws/13786/20.pdf

     

    al

  • 6. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    alalam

    Actually you are quite right, you dont need an IP address on an interface. All thats really required is the router be able to resolve the exit interface for a particular destination. all route is a table with a hop or a hole, once a destination prefix is determined, all the router determines is the exit interface (hole) to que the packet on.

     

    only broadcast, multi access protocols technologies need to resolve a destination layer 2 address. ie IP uses arp to resolve a destination MAC.

     

    point to point links dont need a destination MAC, and non broadcast multi access protocols use other technologies like Lane services for ATM. to map destinations to interfaces.

     

    configuration is fairly simple, search "ip unnumbered" and the cisco site will kick out dozens of applications

     

    below is a link to one of the technology guides

     

    http://www.cisco.com/image/gif/paws/13786/20.pdf

     

    al

  • 7. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    alalam

    Actually you are quite right, you dont need an IP address on an interface. All thats really required is the router be able to resolve the exit interface for a particular destination. all route is a table with a hop or a hole, once a destination prefix is determined, all the router determines is the exit interface (hole) to que the packet on.

     

    only broadcast, multi access protocols technologies need to resolve a destination layer 2 address. ie IP uses arp to resolve a destination MAC.

     

    point to point links dont need a destination MAC, and non broadcast multi access protocols use other technologies like Lane services for ATM. to map destinations to interfaces.

     

    configuration is fairly simple, search "ip unnumbered" and the cisco site will kick out dozens of applications

     

    below is a link to one of the technology guides

     

    http://www.cisco.com/image/gif/paws/13786/20.pdf

     

    al

  • 8. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    alalam

    Actually you are quite right, you dont need an IP address on an interface. All thats really required is the router be able to resolve the exit interface for a particular destination. all route is a table with a hop or a hole, once a destination prefix is determined, all the router determines is the exit interface (hole) to que the packet on.

     

    only broadcast, multi access protocols technologies need to resolve a destination layer 2 address. ie IP uses arp to resolve a destination MAC.

     

    point to point links dont need a destination MAC, and non broadcast multi access protocols use other technologies like Lane services for ATM. to map destinations to interfaces.

     

    configuration is fairly simple, search "ip unnumbered" and the cisco site will kick out dozens of applications

     

     

    al

  • 9. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    alalam

    Actually you are quite right, you dont need an IP address on an interface. All thats really required is the router be able to resolve the exit interface for a particular destination. all route is a table with a hop or a hole, once a destination prefix is determined, all the router determines is the exit interface (hole) to que the packet on.

     

    only broadcast, multi access protocols technologies need to resolve a destination layer 2 address. ie IP uses arp to resolve a destination MAC.

     

    point to point links dont need a destination MAC, and non broadcast multi access protocols use other technologies like Lane services for ATM. to map destinations to interfaces.

     

    configuration is fairly simple, search "ip unnumbered" and the cisco site will kick out dozens of applications

     

    below is a link to one of the technology guides

     

    http://www.cisco.com/image/gif/paws/13786/20.pdf

     

    al

  • 10. Re: Why does each interface on a router has an IP address instead of router having only IP address for itself.
    alalam

    Actually you are quite right, you dont need an IP address on an interface. All thats really required is the router be able to resolve the exit interface for a particular destination. all route is a table with a hop or a hole, once a destination prefix is determined, all the router determines is the exit interface (hole) to que the packet on.

     

    only broadcast, multi access protocols technologies need to resolve a destination layer 2 address. ie IP uses arp to resolve a destination MAC.

     

    point to point links dont need a destination MAC, and non broadcast multi access protocols use other technologies like Lane services for ATM. to map destinations to interfaces.

     

    configuration is fairly simple, search "ip unnumbered" and the cisco site will kick out dozens of applications

     

    below is a link to one of the technology guides

     

    http://www.cisco.com/image/gif/paws/13786/20.pdf

     

    al