Does a router need to have an IP address? if the answer is yes, then what is the router IP address used for (one reason I can think of is NAT, but not all routers are used for NAT)?
Theoretically no, practically yes.
There is nothing fundmamental about IP forwarding that requires the router to have an IP address, however there are several practical considerations that mean at least one IP addess is needed.
- To send a packet on an ethernet-like interface a MAC address is required, this MAC address is nearly always obtained by performing an arp (nd for ipv6) lookup on the "next-hop IP address" from the routing table. So to direct packets over and ethernet-like interface the recipiant must have an IP address.
- Most modern dynamic routing protocols run on top of IP, so the router will need an IP address to implement those protocols.
- Most routers are administered remotely, so the router will need an IP address for administration.
- If something goes wrong (packet to big, destination unreachable etc) when routing a packet, then routers will often use ICMP to report this to the sender. This is particularly important in mixed-mtu networks. A source address is needed for ICMP packets.
The traditional way of configuring a router is to have seperate IP addresses for each interface, and a "loopback" IP that repreents the router regardless of what interfaces are currently operational. With some routers it is practical to run with only the loopback IP but it's really not very practical to run with no IP at all.