Solaris Network Configuration

Solaris Network configuration is a little bit different to Debian.
Because i always forget it, there’s a quick explanation of the necessary steps (taken from here and used with Solaris 5,6,7,8 +9).

/etc-Files

All configuration data, such as IP addresses, gateways, and so on, can be defined and changed at runtime level.
But first of all you have to activate the interface (load the driver), e.g with ifconfig qfe0 plumb

However, only those definitions stored in /etc files will survive the next reboot.
The host name can be found in these files:

  • /etc/nodename
  • /etc/hostname.<interface-name>
  • /etc/inet/hosts
  • /etc/net/{ticlts,ticots,ticotsord}/hosts

/etc/nodename defines the name of the system. Looking from a network perspective, a system with multiple network interfaces and multiple IP addresses can have multiple names, each one defined in /etc/inet/hosts. One of these names may be equal to the nodename, but this is not necessarily the case.
Certain files create the connection between IP-addresses and interface names. These are named /etc/hostname.<interface-name><number>.

The most common interface names are:

  • le Ethernet on older SPARC® systems
  • hme FastEthernet on most UltraSPARC® systems
  • eri FastEthernet on most UltraSPARC-III systems
  • qfe FastEthernet on QuadFastEthernet-extension cards
  • bge Four 10/100/1000Base-T Ethernet (Sun Fire)

Example:
An Ultra 60 workstation with QFE (QuadFastEthernet) has five network interfaces: hme0 (on board), qfe0, qfe1, qfe2 and qfe3 (on the QFE-card). Nodename is sparky, and the /etc/inet/hosts
looks like this:

127.0.0.1      localhost
192.168.222.17 sparky sparky.example.com
194.x.x.x      sparky-ext

The identity of the system in the internal LAN using the address 192.168.222.17 should be sparky.
Accordingly, the file hostname.hme0 must contain the name sparky.
sparky-ext is an address assigned by an Internet Service Provider (ISP): 194.x.x.x. That circuit is connected to the first QFE port, qfe0. So the file hostname.qfe0 contains the string sparky-ext.
qfe1-3 are currently not used. Do not create hostname.* files for unused interfaces to avoid Solaris OS error messages complaining about interfaces with no network cables attached.

!!! A system with more than one network interface will automatically route between the subnets (i.e. 192.168.222… and 194.x.x…) !!!
During boot, the message “machine is a router” is printed. If this behavior is not desired, create an empty file /etc/notrouter and reboot.
The netmasks for the IP-addresses are defined in the file /etc/netmasks.

Routing

The default router (or standard-gateway) can be entered with its IP address into the file /etc/defaultrouter. If you specify a host name in that file, make sure the host name is defined in /etc/inet/hosts.

The equivalent runtime commands are:

  • Delete all current routes: route flush
  • Define 1.2.3.4 as default router: route add default 1.2.3.4
  • Check with netstat -r

DNS

Enter your DNS server into the file /etc/resolv.conf

nameserver 192.168.222.254

Tell Solaris OS software to use DNS when resolving host names. Edit /etc/nsswitch.conf,and add dns after files in the line starting with hosts.

# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

~
~
hosts:      files dns
~
~

sys-unconfig

If you want to change the network configuration and you are unsure which files are involved, there is an easy solution:
The command sys-unconfig shuts down the machine. After the next reboot (enter boot at the OK prompt), all network-related questions you know from the Solaris OS installation tool are asked again (IP address, gateway, netmask, and so on).

Virtual Interfaces

Sometimes, it may be useful to define two IP addresses for a system with only one physical network interface.
This can be done in the same manner like “normal” interfaces. The only difference is that you now use a interface <interface-name>:<number

Example:
# ifconfig hme0:1 172.16.1.27 netmask 255.255.255.0
# ifconfig -a
lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
        inet 127.0.0.1 netmask ff000000
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 192.168.222.7 netmask ffffff00 broadcast 192.168.222.255
        ether 8:0:20:86:94:6f
hme0:1: flags=843<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 172.16.1.27 netmask ffffff00 broadcast 172.16.1.255

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>