Solaris 10 Commad Line Guide – Networking Configuration

To bind an IP address to a Network Interface Card

#ifconfig –a   >> to check the configuration
#ifconfig qfe0 plumb   >> to enable the first Network Interface Card
#ifconfig qfe0 <ip address> netmask <subnet> up  >>to bind IP address, subnet, and enable the configuration

Create a file on /etc directory – hostname.qfe0 with hostname entry
Add entry on /etc/netmasks if IP address is on different subnet
Add entry on /etc/inet/hosts file with IP address and hostname

Example:

#ifconfig –a
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 202.40.231.2 netmask ffffff00 broadcast 202.40.231.255
ether 8:0:20:9f:51:fe

#ifconfig qfe0 plumb
#ifconfig qfe0 202.40.xxx.3 netmask 255.255.255.0 up
#ifconfig –a
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 202.40.xxx.2 netmask ffffff00 broadcast 202.40.xxx.255
ether 8:0:20:9f:51:fe
qfe0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 202.40.xxx.3 netmask ffffff00 broadcast 202.40.xxx.255

To change IP Address

#ifconfig qfe0 down   >>to disable the first Network Interface Card

To remove Network Interface Card

#ifconfig qfe0 unplumb   >> to remove the first Network Interface Card

To bind a virtual IP address to Network Interface Card

#ifconfig qfe0:1 plumb    >>in some cases this is not needed if qfe0 has been plumb
#ifconfig qfe0:1 202.40.xxx.x netmask 255.255.255.0 up

Create a file on /etc directory – hostname.qfe0:1 with hostname entry
Add entry on /etc/netmasks if IP address is on different subnet
Add entry on /etc/inet/hosts file with IP address and hostname

NOTE:

If adding a quad port Network Interface Card, the naming convention will be qfe0, qfe1, qfe2, qfe3.
If adding a single port Network Interface Card, the naming convention will be hme1, hme2, hme3.
The onboard Network Interface Card is hme0
If adding a virtual IP address, the naming convention will be hme0:1, hme0:2, up to hme0:3 only for hme0, or qfe0:1, qfe0:2, up to qfe0:3 only for
qfe0, depending on the number of hme and qfe port used.

To hardcode the speed of the Network Interface Card

Example:
You want to hardcode 100Full Duplex for hme0
#ndd –set /dev/hme instance 0
#ndd –set /dev/hme adv_100fdx_cap 1
#ndd –set /dev/hme adv_100hdx_cap 0
#ndd –set /dev/hme adv_10fdx_cap 0
#ndd –set /dev/hme adv_10hdx_cap 0
#ndd –set /dev/hme adv_autoneg_cap 0

Create an input on the file /etc/system so that when your system rebooted it will run the NIC in 100Full Duplex automatically.
set hme:hme_adv_100fdx_cap=1
set hme:hme_adv_100hdx_cap=0
set hme:hme_adv_10fdx_cap=0
set hme:hme_adv_10hdx_cap=0
set hme:hme_adv_autoneg_cap=0

To check the status
#ndd /dev/hme \?     >>displays all command options for ndd
#ndd /dev/hme link_status    >>displays the hme0 link status

The above configurations should be followed in order.

1 = Capable/Enable
0 = Disable
hme1 = instance 1
hme2 = instance 2
hme3 = instance 3

The system on the other end of network cable should be hardcode to 100Full Duplex also. If the other end is a switch, check your vendor manuals on how to
do it.

To monitor packets traveling in your NIC ports

Example:
You want to monitor your hme0 port of packets coming from IP address 202.40.224.14
#snoop –d hme0 | grep 202.40.224.14

You want to monitor your qfe1 port of packets coming from host server1
#snoop –d qfe1 | grep server1

You want to monitor your hme1 ports of all packets
#snoop –d hme1

To add or remove a static route

Example:
You want to add a static route to network 192.168.16.0 to your default gateway of 10.236.74.1
#route add –net 192.168.16.0 10.236.74.1
then create a script, so that when the system rebooted the route will automatically added
#cd /etc/rc2.d
#vi S168staticroute
Add the following line
route add –net 192.168.16.0 10.236.74.1

You want to add a static route to host 192.168.64.4 to your default gateway of 10.236.74.1
#route add 192.168.64.4 10.236.74.1
then create a script, so that when the system rebooted the route will automatically added
#cd /etc/rc2.d
#vi S168staticroute
Add the following line
route add 192.168.64.4 10.236.74.1

You want to delete the static route to network 192.168.16.0 to your default gateway of 10.236.74.1
#route delete –net 192.168.16.0 10.236.74.1

You want to delete the static route to host 192.168.64.4 to your default gateway of 10.236.74.1
#route delete 192.168.64.4 10.236.74.1

Advertisement

14 responses to “Solaris 10 Commad Line Guide – Networking Configuration

  1. Pingback: WordpressC » Blog Archive » Solaris 10 Commad Line Guide - Networking Configuration « AZIZ’s BLOG

  2. I’m a fan of you blog web site and its really useful. Kindly tell me do you have steps on how to install Oracle RAC 10g on Sun cluster. Please if you guys have this kindly assist.

    Thanks
    Francis

  3. For the persistent static routes there is no need to create startup scripts on Solaris 10, just use ‘-p’ parameter in route command, e.g.:

    route -p add -net …
    will add static route persistent through system boots.

  4. I am really tahnkful to your website..its really very useful for me..
    Please provide me Sun solaris 10 exam 2 preparation stuf..

  5. when i execute the below cmd
    #ifconfig qfe0 plumb
    output as:
    ifconfig: cannot openlink “qfe0”: DLPI link does not exist.

    Please help me in that, m struggling for configuring static IP in solaris 10.

    • Hi Narendra,
      Are you made sure already that you NIC card are installed properly? sometimes its caused by NIC driver. Check whether you NIC card installed or not with ‘dmesg’ command.

  6. Hi Aziz,

    Is there a way to identify a virtual network interface? When I wlak the kstat chain, I haven’t found a distinctive attribute which would tell the difference between physical and virtual interfaces.

    Thanks,
    Arun

  7. hai frnd i want to configure my desktop with sun solaris 10, but only 1 interface showing , so i want to configure 2 nic cards in my pc, so pls help me to download a nic card driver for configuration

    • Solaris 9/10 shipped with almost all NIC card drivers, you just need to ‘plumb’ your 2nd NIC card port and configure the ip address. If let say you have 1 NIC card with 4 ports and your first nic card detected as “e1000g0”, then your 2nd port driver would be “e1000g1”. type “ifconfig e1000g1 plumb” and configure the ip address.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.