What a default gateway is and why you need it
Your default gateway is the device — usually your router — that your computer uses to send data outside your local network. When your device needs to reach a website, send an email, or connect to any resource not on your home or office network, it sends that traffic to the gateway first. The gateway then forwards it onward.
You need to know your default gateway when you're troubleshooting network problems, configuring advanced settings, or logging into your router to change your Wi-Fi password or adjust security rules. It's also the address you enter in a web browser to access your router's control panel.
Finding it takes less than a minute and requires no special tools — just a command you run from your computer's built-in terminal or command prompt.
Key Takeaways
- On Windows, open Command Prompt and type ipconfig to see your default gateway listed as "Default Gateway" in the output.
- On Mac and Linux, open Terminal and type route -n get default (Mac) or ip route (Linux) to find the gateway address.
- Your default gateway is almost always your router's IP address, typically something like 192.168.1.1 or 192.168.0.1.
- Once you have the gateway address, you can enter it into a web browser to log into your router's settings.
Finding your default gateway on Windows
Open the Start menu and type "Command Prompt" into the search box. Click the Command Prompt app to open it.
At the command prompt, type ipconfig and press Enter. Your computer will display a list of network adapters and their settings. Look for the section labeled with your active connection — usually "Ethernet adapter" if you're plugged in with a cable, or "Wireless LAN adapter" if you're on Wi-Fi.
In that section, find the line that says "Default Gateway" followed by an IP address. That address is what you're looking for. It will typically look like 192.168.1.1, 192.168.0.1, or 10.0.0.1. If you see multiple adapters listed, check the one that shows an IPv4 address — that's the one your computer is actually using to connect.
Finding your default gateway on Mac
Open Spotlight search by pressing Command + Space, type "Terminal," and press Enter. The Terminal app will open.
At the terminal prompt, type route -n get default and press Enter. Your Mac will display routing information. Look for the line that starts with "gateway:" — the IP address next to it is your default gateway.
Alternatively, you can type netstat -nr | grep default to see the same information in a different format. Both commands show the same gateway address.
Finding your default gateway on Linux
Open a terminal window. The method varies by desktop environment, but you can usually right-click on the desktop and select "Open Terminal Here," or search your applications menu for "Terminal."
Type ip route and press Enter. Your system will display routing information. Look for the line that starts with "default via" — the IP address immediately after those words is your default gateway.
If that command doesn't work, try route -n instead. Look for the line where the "Destination" column shows 0.0.0.0 or default — the "Gateway" column on that line contains your default gateway address.
What to do once you have your gateway address
Once you know your default gateway address, you can use it to access your router's control panel. Open a web browser on any device connected to your network and type the gateway address into the address bar — for example, 192.168.1.1 — and press Enter.
Your router will prompt you for a username and password. If you haven't changed these from the factory defaults, check the label on the back or bottom of your router — it usually lists the default login credentials. Common defaults are admin/admin or admin/password, but this varies by manufacturer.
Once logged in, you can change your Wi-Fi password, adjust security settings, restart the router, or check which devices are connected. If you've forgotten your router's password, you can usually reset it to factory defaults by holding down a small reset button on the device for 10 to 15 seconds, though this will erase any custom settings you've made.
Troubleshooting if you don't see a default gateway
If you run the command for your operating system and don't see a default gateway listed, your computer may not be connected to the network properly. Check that your Wi-Fi is turned on and connected to your network, or that your ethernet cable is plugged in securely.
If you're connected but still don't see a gateway, your network adapter may not have received an IP address from your router. Restart your router by unplugging it for 30 seconds, then plugging it back in. Wait two minutes for it to fully boot, then run the command again.
If the problem persists, restart your computer as well. If you still see no gateway after both devices have restarted, your router may have a configuration problem, and you may need to reset it to factory defaults or contact your internet service provider for help.
Frequently Asked Questions
Is my default gateway always my router?
In a home or small office network, yes — your default gateway is almost always your router. In larger networks, it could be a different device, but the command will still show you what your computer is actually using.
Can I change my default gateway?
You can, but you shouldn't unless you know what you're doing. Changing it incorrectly will break your internet connection. If you need to change it, you do so through your network settings, not through the command line. On Windows, this is in Settings > Network > Advanced Network Settings. On Mac and Linux, it's typically done through your network configuration files or graphical network manager.
What if I have multiple default gateways listed?
This can happen if you have multiple network adapters active at once — for example, both Wi-Fi and ethernet plugged in. Your computer will use one as primary. If you want to use a specific connection, disable the others in your network settings, or unplug the ethernet cable if you want to use Wi-Fi only.
Is knowing my default gateway a security risk?
No. The gateway address is visible to anyone on your network and is not sensitive information. What matters is the password you use to log into your router — keep that secure and change it from the factory default.