LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 04-05-2008, 02:37 PM   #1
rithik_ghoshal
Member
 
Registered: Aug 2006
Location: kolkata , India
Distribution: fedora (7,9), solaris (sxde 9/07 & 1/08), opensolaris 2008.05
Posts: 49

Rep: Reputation: 15
Question add route permanently


I am using solaris express developer edition 9/07.
I need to execute this command "route add default 192.168.1.1" each time after a reboot. I think editing a file like /etc/rc2.d may solve this problem.

please help me to solve this issue.

Thank you.
 
Old 04-05-2008, 04:40 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Editing /etc/defaultrouter is a better option.

"man defaultrouter" for details.
 
Old 04-05-2008, 04:46 PM   #3
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
If you were running Fedora or RHEL, I would tell you that you need to add a GATEWAY entry to your /etc/sysconfig/network-scripts/ifcfg-eth0 file, but I'm not sure where this would go in Solaris.

My file looks like this:-
Code:
# Broadcom Corporation NetXtreme BCM5702X Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.3.255
HWADDR=00:02:55:56:11:0C
IPADDR=192.168.3.100
NETMASK=255.255.255.0
NETWORK=192.168.3.0
ONBOOT=yes
GATEWAY=192.168.3.1
TYPE=Ethernet
So perhaps you know where a similar file lives on your system.

Hope that helps you find the answer, and sorry but I don't know Solaris at all.
 
Old 04-06-2008, 01:43 AM   #4
rithik_ghoshal
Member
 
Registered: Aug 2006
Location: kolkata , India
Distribution: fedora (7,9), solaris (sxde 9/07 & 1/08), opensolaris 2008.05
Posts: 49

Original Poster
Rep: Reputation: 15
I already edited /etc/defaultrouter.
now ,
#cat /etc/defaultrouter is giving me..
192.168.1.1

but after a reboot , my browser is not being able to display webpages though wireless indicator in my laptop is showing that a connection has already established. even router configuration page is also opening in browser.

when i am executing "route add default 192.168.1.1" , and after that
"svcadm restart nwam" a popup message is showing something like "brought interface wpi0 up, got address 192.168.1.103" and after that browser is being able do display all webpages.

I go through "man defaultrouter" but can't get what should be written in /etc/defaultrouter except 192.168.1.1

I think I am adding a new default gateway using "route add default 192.168.1.1" . Now please tell me how to make it permanent.

thanks to all of you !!
 
Old 04-06-2008, 02:42 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
As you are using nwam and dhcp, all the configuration including IP, DNS and route is automatic. There should be no need to set the default route. Perhaps is there a misconfiguration on the dhcp server side.

What says:

Code:
/sbin/dhcpinfo -i wpi0 Router
 
Old 04-07-2008, 04:10 AM   #6
sshd.root
LQ Newbie
 
Registered: Jan 2008
Posts: 17

Rep: Reputation: 0
You can add permanently route:

Code:
# route -p add  192.168.24.0/22 192.168.4.1
add net 192.168.24.0/22: gateway 192.168.4.1
add persistent net 192.168.24.0/22: gateway 192.168.4.1
 
Old 04-08-2008, 09:54 AM   #7
rithik_ghoshal
Member
 
Registered: Aug 2006
Location: kolkata , India
Distribution: fedora (7,9), solaris (sxde 9/07 & 1/08), opensolaris 2008.05
Posts: 49

Original Poster
Rep: Reputation: 15
@jlliagre

actually I was not using dhcp , I was using static ip address.
thank you for your suggestion and comments.

@sshd.root

Thank you. that '-p' solved my problem.
 
Old 04-08-2008, 10:20 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
If you are using static IP, you'd better disable nwam which sole purpose is automatizing DHCP and enable the previous way of configuring networking.

Code:
svcadm disable physical:nwam
svcadm enable physical:default
 
Old 04-08-2008, 03:10 PM   #9
rithik_ghoshal
Member
 
Registered: Aug 2006
Location: kolkata , India
Distribution: fedora (7,9), solaris (sxde 9/07 & 1/08), opensolaris 2008.05
Posts: 49

Original Poster
Rep: Reputation: 15
Thanks a lot for this information. I didn't know that. Now I get why am stands for auto magic.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
permanently add static route glock19 Linux - Networking 27 07-27-2015 04:59 PM
noob: ip route add vs route add jCash Linux - Networking 1 07-19-2007 11:12 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
how to permanently add route? rob99 Linux - Networking 5 07-19-2003 06:39 AM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 04:04 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration