0

Can the router's ethernet interface have multiple IP's of the same subnet or different subnet mask?

If yes what's the use?

1

Can the router's ethernet interface have multiple IPs of the same subnet

Generally yes, but that may be be limited by the system.

or different subnet mask?

No, not if there's overlap. E.g. 192.168.0.1/24 and 192.168.0.129/25 simultaneously aren't possible because they overlap. 192.168.0.1/24 and 192.168.0.129/24 (same subnet), or 192.168.0.1/24 and 192.168.1.129/25 (distinct subnets) are generally possible.

Overlapping subnets make no sense on a single interface and normally cannot even be configured. Different subnet masks (prefix lengths) are possible for different subnets, however, e.g. 192.168.0.1/24 and 10.0.1.0/16.

what's the use?

One use is with NAT, when multiple public IP addresses are mapped across the same router and usually forwarded differently. Another use is with services bound to specific IP addresses and using different default gateways. Also, if you're renumbering your network you often use multiple IP addresses for key devices temporarily and route between them.

Note that while multiple IPv4 addresses are not that common, IPv6 uses multiple addresses routinely (link-local, unique-local, global, ...), even of the same type. For instance, you can slowly phase out a changing global prefix while phasing in the new one at the same time.

8
  • Yah but u didn't explain why can't we assign another ip from same subnet mask like 192.168.1.5 and 172.168.1.3?
    – Rohit
    Sep 4 at 12:26
  • @Rohit By networking standards, you can assign multiple IP addresses from the same subnet or from any other to a single host NIC - I've done that quite a few times. A given host might not allow that but what hosts do or don't do is explicitly off-topic here, see the help center.
    – Zac67
    Sep 4 at 12:33
  • so can we say that in IP aliasing we can add multiple ip address from same and different subnet mask?
    – Rohit
    Sep 4 at 12:43
  • @Rohit Wouldn't call that "aliasing" though. As noted in the answer, you can't have overlapping subnets but anything else.
    – Zac67
    Sep 4 at 12:52
  • But in this video youtu.be/if0OM5-Sd0c he is using same subnet mask why?
    – Rohit
    Sep 4 at 13:05
0

Juniper router allows multiple IP addresses from the same subnet to be configured on an interface. However, practically only one is chosen to be the primary:

Configuring the Preferred Address for an Interface:

The preferred address on an interface is the default local address used for packets sourced by the local router to destinations on the subnet. By default, the numerically lowest local address is chosen. For example, if the addresses 172.16.1.1/12, 172.16.1.2/12, and 172.16.1.3/12 are configured on the same interface, the preferred address on the subnet (by default, 172.16.1.1) would be used as a local address when you issue a ping 172.16.1.5 command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.