
Your Mac’s default gateway is usually your home or office router. To find it in Terminal, open the app and run:
route -n get default
Look for the line beginning with gateway:. The address on that line is the router address your Mac currently uses for traffic outside its local network.
You can also use this shorter command:
netstat -rn | grep default
The address in the Gateway column is your default gateway. These commands only read your Mac’s current network configuration; they do not change settings or disconnect your connection.
Quick Answer
- Open Terminal from Applications > Utilities.
- Run:
bash
route -n get default
- Find the
gateway:line. - The address next to it—often a private address such as
192.168.x.xor10.x.x.x—is your current default gateway.
If your Mac has multiple active network connections, check the interface shown in the output. It identifies whether the route is using Wi-Fi, Ethernet, or another connection.
What “Router” and “Default Gateway” Mean
A router connects your local network to other networks, including the internet. A default gateway is the address your Mac sends traffic to when it does not have a more specific route.
In a typical home network, the router and default gateway are the same device. However, the terms describe different roles:
- Router: The network device that forwards traffic.
- Default gateway: The router address listed in your Mac’s active routing table.
The gateway address is usually a private IPv4 address. Common private address ranges include 192.168.x.x, 10.x.x.x, and 172.16.x.x through 172.31.x.x. Your network may use a different address.
Finding the gateway can help when you need to:
- Open your router’s configuration page in a browser
- Troubleshoot an internet connection
- Confirm which network interface is active
- Compare routing behavior between Wi-Fi and Ethernet
- Identify whether your Mac is using a VPN or another virtual network service
This is separate from finding your Mac’s own local IP address. If you need that address, see How to Find a Mac’s Local IP Address Using Terminal.
Find the Default Gateway with route
The route command displays information from macOS’s routing table. The -n option prevents name lookups, and get default asks specifically for the route used when no more specific destination is available.
Before running it, open Terminal:
- Press Command-Space to open Spotlight.
- Type
Terminal. - Press Return.
- Enter this command and press Return:
route -n get default
The output includes several fields. Find:
gateway:
interface:
The value after gateway: is the default gateway. The value after interface: is the network interface macOS is using for that route.
For example, if the output contains a gateway address, do not confuse it with the destination: or local address: fields. You want the value specifically associated with gateway:.

This command is read-only. It does not modify the routing table, restart networking, or change your router.
Check the IPv4 Gateway
The command above normally reports the active default route that macOS selects. If you want to inspect the IPv4 routing table directly, run:
netstat -rn -f inet
The -r option displays the routing table, -n keeps addresses numeric, and -f inet limits the result to IPv4. Find the row whose destination is default. The gateway appears in the Gateway column.
To show only the default IPv4 route, run:
netstat -rn -f inet | grep default
The output may include the network interface at the end of the row. This helps you determine whether the route is associated with Wi-Fi, Ethernet, or another interface.
Find the Gateway with a Short Command
If you only need the default route line, use:
netstat -rn | grep default
This command performs two read-only operations:
netstat -rnprints the routing table using numeric addresses.grep defaultfilters the result so only lines containingdefaultremain.
The gateway is the address in the row’s gateway column. The interface is commonly shown in the final column.

This method is convenient for a quick check, but route -n get default provides more context about the selected route. Use the longer command when you are troubleshooting multiple interfaces or need to confirm the route’s details.
Identify the Network Interface
Your Mac can have several network interfaces, including Wi-Fi, Ethernet, USB adapters, VPN connections, and virtual interfaces. The default route tells you which one is currently being used.
Run:
route -n get default | grep -E 'gateway:|interface:'
This filters the result to the gateway and interface lines. It does not change anything.
A physical interface may have a short name such as en0 or en1, but do not assume which connection a name represents on your Mac. To see interface names and their status, run:
ifconfig
This prints detailed information for every network interface. Look for interfaces marked status: active. You can then compare the interface named by the default route with the active interfaces on your Mac.
The ifconfig command is also read-only. It may produce a large amount of output, so use it mainly when the route information alone does not explain your connection.
Find the IPv6 Default Gateway
IPv6 uses a separate routing table. To inspect the IPv6 default route, run:
netstat -rn -f inet6
Look for a row whose destination is default. The corresponding gateway may be a longer IPv6 address rather than a familiar private IPv4 address.
To filter the output:
netstat -rn -f inet6 | grep default
Your Mac may have an IPv4 default gateway, an IPv6 default gateway, or both. The result depends on how the network, router, internet provider, and Mac are configured.
If an application or troubleshooting instruction specifically asks for an IPv4 router address, use the IPv4 command:
netstat -rn -f inet
Open the Router’s Address
Once you have the gateway address, you can try opening it in a web browser. Replace the example address below with the address shown by your command:
open "http://192.168.1.1"
The open command asks macOS to open the URL using your default browser. It does not change router settings.
If the router uses HTTPS, try:
open "https://192.168.1.1"
Do not run either command until you replace the example with your actual gateway address. Some routers use a different web address, and some network administrators disable browser-based management. You may also see a certificate warning or a login page. The gateway address alone does not provide administrator access.
The open command only launches the address. To close the browser tab, close it in the browser; there is no Terminal change to reverse.

Troubleshooting
route Shows No Gateway
If route -n get default reports that it cannot find a route or does not show a gateway, your Mac may not currently have an active network connection.
Check the routing table:
netstat -rn
Then check active interfaces:
ifconfig
Look for an active interface and a default route. If neither appears, check System Settings > Network and confirm that Wi-Fi, Ethernet, or the relevant service is connected.
More Than One Default Route Appears
Multiple default routes can occur when your Mac has more than one active connection or uses a VPN. In this situation, do not simply choose the first line from a broad routing-table listing.
Run:
route -n get default
This asks macOS which default route it is currently selecting and identifies the associated interface. If you need to investigate VPN or virtual interfaces, compare the reported interface with the output from:
ifconfig
Temporarily disconnecting a network service can change routing, but it may interrupt network access and close or disrupt connected applications. Save work before changing network connections, and reconnect the service through System Settings > Network when finished.
The Gateway Is Not the Address You Expected
A home router may use an address other than the one printed in online examples. Do not substitute a common address such as 192.168.1.1 unless your command actually reports it.
The address may also belong to:
- A mesh Wi-Fi system
- A cellular or USB network device
- A VPN
- A corporate or school network
- A virtual machine or security product
The interface: field helps explain which connection supplied the route.
The Router Page Does Not Open
First, confirm the address:
route -n get default | grep gateway
Then try the address in a browser without adding a path after it. If it still does not open:
- Confirm that your Mac is connected to the same network.
- Try both
http://andhttps://if appropriate. - Check whether the router blocks local administration.
- Disconnect from a VPN only if permitted and safe for your network.
- Ask the network administrator whether router management is restricted.
Do not repeatedly guess administrator passwords. Failed login attempts may trigger account lockouts or other security controls.
The Command Is Not Found
route and netstat are standard macOS command-line tools. If Terminal says a command cannot be found, check that you typed it exactly and did not include extra punctuation.
You can also verify the command location with:
command -v route
command -v netstat
These commands only report where the executables are located. They do not install or modify anything.
You Need to Check Connections Instead
The default gateway shows where general traffic is sent, but it does not show every connection your Mac has opened. For that task, use a command intended for connection inspection, such as the methods described in How to Check Open Network Connections on a Mac Using Terminal.
Frequently Asked Questions
Is the default gateway always my router?
Usually, especially on a home network. However, it can be a VPN endpoint, a managed network device, or another gateway rather than the physical router in your building.
What is the difference between my Mac’s IP address and the gateway?
Your Mac’s IP address identifies your Mac on the local network. The gateway address identifies the device your Mac uses to reach other networks. They should normally be different addresses.
Can I find the gateway without changing anything?
Yes. The commands in this guide—such as route -n get default and netstat -rn—read network information only. They do not change network settings.
Why does the gateway look like a private IP address?
Routers commonly use private addresses inside local networks. These addresses are not directly routable across the public internet, but they allow devices on the local network to communicate with the router.
Can I use the gateway address to log in to the router?
You can try opening it in a browser, but access still requires the router’s administrator credentials. Some networks also prevent users from managing the gateway.
What if I am connected through both Wi-Fi and Ethernet?
Use route -n get default to see the route macOS is currently using. The interface: field identifies the connection associated with that route.
Final Thoughts
The fastest way to find your Mac’s current router or default gateway is:
route -n get default
Read the value beside gateway: and check interface: if you have multiple network connections. Use netstat -rn -f inet or netstat -rn -f inet6 when you need to inspect the IPv4 or IPv6 routing table separately.