Solaris: How do I setup a default static route / static router IP address?
/etc/defaultrouter is the configuration file for default router under Solaris os. The /etc/defaultrouter file can contain the IP addresses or hostnames of one or more default routers, with each entry on its own line. If you use hostnames, each hostname must also be listed in the local /etc/hosts file, because no name services are running at the time that defaultrouter is read.
The default routes listed in this file replace those added by the kernel during diskless booting. An empty /etc/defaultrouter file will cause the default route added by the kernel to be deleted.
(1) First login to Solaris box as a root user:
# su
The /etc/defaultrouter is configuration file for default router under Sun Solaris. Open the file /etc/defaultrouter and add the router IP address:
# vi /etc/defaultrouter
Append IP address:
192.168.1.254
Restart the Solaris network with following command:
# /etc/init.d/network restart
(3) Or you can add the router IP to default route table as follows:
# route add default 192.168.1.254
Output:
add net default: gateway 192.168.1.254
Finally use nslookup and ping command to check network settings:
$ ping 192.168.1.254
$ nslookup nixcraft.com
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- Configure static routes in Debian or Red Hat Linux systems
- Setup VMWARE Host as router for Solaris, Linux, FreeBSD, and Windows XP Guest OS
- Linux How to setup multi homing network
- Quagga: Linux Dynamic Routing Software
- No Route to Host error and solution
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!



Is it just me or is this answer, answering “How do I setup a default route in Solaris?” Rather than “How do I setup a static route?”
I suppose the default route is also considered a static route but this still didn’t really help me.
No - you’re 100% correct. This article answers the question better.