≡ Menu

How to add IP Address / Default Gateway on Sun Solaris

Adding IP address and default gateway is rather straight forward as long as the interface is loaded. To see whether the interface is loaded, issue the command ifconfig –a

You should see something like the following…

bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
rtls0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 0.0.0.0 netmask 0
ether 0:6:4f:47:76:1e

In this case, we will be adding the IP address and subnet mask to rtls0 along with the default gateway.

IP Address: 192.168.1.60
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1

Here is how its done…

bash-3.00# ifconfig rtls0 192.168.1.60 netmask 255.255.255.0 up
bash-3.00# route add default 192.168.1.1
add net default: gateway 192.168.1.1
bash-3.00# ping 4.2.2.2
4.2.2.2 is alive

Success! We can now ping a WAN IP! and here is the new output of ifconfig -a

bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv 4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
rtls0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.60 netmask ffffff00 broadcast 192.168.1.255
ether 0:6:4f:47:76:1e

Comments on this entry are closed.

Next post:

Previous post:

Copyright © Nish Vamadevan 2002-2017. All Rights Reserved. Terms and Policies.