Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP address & multiple gateways

Status
Not open for further replies.

uxadmin

IS-IT--Management
Jul 24, 2001
22
0
0
IN
How to assign static IP address to Network interface? I used ifconfig blaa blaa, but after system reset IP address unsets. I used sys-unconfig but still not working. Also I want to add two static gateways for 2 different networks. I added using route add but these entries vanishes after M/C reboot. Syntax of /etc/defaultrouter ????
Thanx in advance,

UXADMIN
 
create a file /etc/hostname.(interface) and the contents of that file are the hostname of that interface. add the host entry to /etc/hosts with the ip address. a static route will automatically be set up when the interface is set to up, using the interface as the gateway and the destination depends on your netmask. so say i want to add an ip address for interface hme0:99, hostname of foo and ip address of 10.10.2.20 and netmask of 255.255.255.0:

create /etc/hostname.hme0:99
edit /etc/hostname.hme0:99 and add foo (the hostname) as the only line of that file
add entry to /etc/hosts (i.e. 10.10.2.20 foo)
put the appropriate netmask for the network in /etc/netmasks (i.e. 10.10.2.0 255.255.255.0)

now on a boot init should configure the interfaces
 
You can write gateway ip address to /etc/defaultrouter file.
example :
/etc/defaultrouter
192.168.1.1
192.165.1.1

Good Luck
 
Thanx lancer & ady, but my problem is diff. I have already done all these things. ifconfig -a shows IP as 0.0.0.0
I checked /etc/hostname.interface, /etc/hosts /etc/nodename etc. Everything is fine but after reboot it vanishes. Owner is root with default file perms. Sometimes even while booting it shows hostname as unknown. I used uname -S 'hostname' but prob. is same.
Reg. /etc/defaultrouter: I used same syntax but it didn't work. B'cos it takes both IPs as default gateway. ( default.... GW1 & default.... GW2) How it will identify which gtw is for which network? I could not get anything from man defaultrouter. e.g. x.x.x.1 is for net 0.0.0.0 & x.x.x.2 is for net 5.5.0.0
Looking for any reply,

uxadmin.
 
did you check netmasks?
After booting what is the entry in nodename?

Ged Jones

Top man
 
in re: setting up multiple gateways, you could do that with a startup script. just put in the route commands. it's cheesy, but it works.

as for your interfaces not configuring, i dunno. seems like you haven't missed anything. wish i could help more there.
 
Thanx lancer, I added one script in rc2.d & my gateway prob. is now solved. For my IP addr. problem: I did like, removed network cable from switch, used sys-unconfig command, applied new settings & para. to system. Rebooted without N/W conn. & then at login prompt connected N/W. Till now it is working fine.
Thanx

uxadmin
 
if you are using solaris 8 then you need to do plumb and then add the ipaddress .ifconfig hme0:12 plumb and then give the address or you can use ifconfig hme0 addif <Ip> .
as mentioned keep it in RC script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top