How to set gateway address to a particular interface? | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How to set gateway address to a particular interface?

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-19-2013
Naveen.6025 Naveen.6025 is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 6 November 2013, 1:42 AM EST
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
How to set gateway address to a particular interface?

How to set gateway address to a particular interface? waht are the files need to update to make it permanent?
Sponsored Links
    #2  
Old 07-19-2013
hicksd8 hicksd8 is offline
Registered User
 
Join Date: Feb 2012
Last Activity: 23 April 2014, 10:10 AM EDT
Location: Cornwall, UK
Posts: 641
Thanks: 23
Thanked 105 Times in 101 Posts
What do you mean by "a particular interface"? Do you have multiple interfaces?

The easy answer is to edit or create the file /etc/defaultrouter and insert the address of the default router (gateway). This file is ascii and editable and should contain just an ip address of the router and nothing else (first line of file, left justified). This change would be permanent.

For example:


Code:
131.156.202.6

Does that help (or did you already know that)?
Sponsored Links
    #3  
Old 07-19-2013
rbatte1 rbatte1 is offline Forum Advisor  
Registered User
 
Join Date: Jun 2007
Last Activity: 24 April 2014, 6:09 AM EDT
Location: North-West UK
Posts: 1,254
Thanks: 375
Thanked 203 Times in 186 Posts
The default router will need to be directly available from any Network Interface Card (NIC) that uses it. If you have:-

Code:
NIC 0  - IP 123.100.100.30, Netmask 255.255.255.224
NIC 1  - IP 168.100.100.30, Netmask 255.255.0.0
NIC 2  - IP 123.100.100.230, Netmask 255.255.255.224

...and you set the default router as 123.100.100.1 , then all the traffic will route through NIC 0 as that is the only one that can get to it. Even NIC 2 on the similar range will be ignored.

What are you trying to achieve? Do you want to have multiple 'default' routes? It is possible, but then you don't know what route will be used for any connection and you end up writing many more firewall rules.



Robin
Liverpool/Blackburn
UK
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Default Gateway address question samnyc UNIX for Dummies Questions & Answers 2 10-19-2011 09:41 AM
How to set server's ip address, router, network mask and set if it is an internal or external ip? zagaruika UNIX for Dummies Questions & Answers 4 11-17-2010 08:44 AM
how we can get gateway address phani_sree Programming 2 12-12-2006 05:52 AM
gateway address sshokunbi UNIX for Dummies Questions & Answers 2 01-23-2002 01:34 PM
IP address and gateway info gguzman UNIX for Dummies Questions & Answers 2 06-27-2001 02:01 AM



All times are GMT -4. The time now is 07:26 AM.