You need to reach a device on a subnet your Mac is not on — an iDRAC on its factory address, a switch, a storage controller on a service network — without giving up the address you already have. macOS lets one interface hold multiple IP addresses at once, and it takes a single command. Tested on macOS Sequoia 15 and Tahoe 26; the ifconfig syntax has been unchanged for many releases, but the System Settings path moved in Ventura 13.
First, find the interface. en0 is the Wi-Fi adapter on most laptops and the Ethernet port on most desktops and docks, so check rather than assume:
networksetup -listallhardwareports
Add and remove multiple IP addresses
sudo ifconfig en0 alias 192.168.50.101/24
sudo ifconfig en0 -alias 192.168.50.101
The address is live immediately, the original one keeps working, and the removal is the same command with a minus.
The netmask rule when both addresses share a subnet
This is the one that produces a command that looks like it worked and a network that does not. It is not folklore — it is in the ifconfig man page, under alias:
> If the address is on the same subnet as the first network address for this > interface, a non-conflicting netmask must be given. Usually 0xffffffff is most > appropriate.
So when the alias is on a different subnet than the primary address, the /24 above is correct. When it is inside the same subnet, it needs a host mask:
sudo ifconfig en0 alias 192.168.1.50/32
The long form sudo ifconfig en0 alias 192.168.1.50 netmask 255.255.255.255 does the same thing. What to avoid is the bare positional form, ifconfig en0 alias 192.168.1.50 255.255.255.255 — it is the shape most commonly pasted from old forum posts, and it is easy to end up with an address that shows up in ifconfig and answers nothing.
Verify
ifconfig en0 | grep inet
netstat -rn -f inet | head
ping -c 3 -S 192.168.50.101 192.168.50.1
The interface should now list multiple IP addresses, and the routing table should show one route per subnet. -S sets the source address, not the route — so a reply proves the alias is bound and usable, not that macOS is choosing it for outbound traffic. The far end still needs a route back.
If macOS pops up Another device on the network is using your computer's IP address, the alias collided with something already live on that subnet. Ping the address from another machine before you assign it.
Why multiple IP addresses do not survive a reboot
An address set with ifconfig is invisible to the configuration agent inside configd, which owns the interface's address list. Any DHCP renewal, service reconfiguration or link event makes it rewrite that list from the stored configuration — and your alias is not in it. In practice you often lose the alias well before any reboot: sleeping the laptop, unplugging a dock or switching networks is enough.
For a temporary address that is the point — nothing is left behind.
When you need it permanently, do not script ifconfig into a login item. Create a second network service, which macOS stores and reapplies itself:
sudo networksetup -duplicatenetworkservice "Ethernet" "Ethernet 2"
sudo networksetup -setmanual "Ethernet 2" 192.168.50.101 255.255.255.0 192.168.50.1
networksetup -listallnetworkservices
The same thing lives in System Settings → Network behind the … menu under the service list. On Wi-Fi services this has been reported since Ventura to write the duplicate's address back onto the original service, so check the original after you set the copy.
The same trick on loopback
alias works on lo0 too, which is the usual way to run two local services that both insist on the same port:
sudo ifconfig lo0 alias 127.0.0.2
And once the alias is up and you can reach that iDRAC, the next thing you probably want is to change its IP address so it stops living on a factory default.
Reference: the macOS ifconfig man page.