The following procedure assumes that you are configuring interfaces for the router after installing the router.
Before You Begin
After the router is physically installed on the network, configure the router to operate in local files mode. This configuration ensures that routers boot even if the network configuration server is down.
For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .
# ipadm create-ip IP-interface
# ipadm create-addr -a address [interface | addr-obj]
# ipadm create-addr -T address-type [interface | addr-obj]
For detailed instruction about how to configure IP interfaces, see Chapter 3, Configuring and Administering IP Interfaces and Addresses in Oracle Solaris, in Configuring and Administering Network Components in Oracle Solaris 11.2 .
Make sure that each IP interface is configured with the IP address of the network for which the system must route packets. Therefore, if the system serves the 192.168.5.0 and 10.0.5.0 networks, then one NIC must be configured for each network.
Caution - Make sure you are thoroughly knowledgeable about DHCP administration before configuring an IPv4 router to use DHCP. |
For example, assume that the names you assigned for the two interfaces of the router are krakatoa and krakatoa-1, respectively. The entries in the /etc/inet/hosts file are as follows:
192.168.5.1 krakatoa #interface for network 192.168.5.0 10.0.5.1 krakatoa-1 #interface for network 10.0.5.0
For example, for IPv4 address notation, such as 192.168.5.0, type the following:
192.168.5.0 255.255.255.0
# ipadm set-prop -p forwarding=on ipv4
Use one of the following commands:
# routeadm -e ipv4-routing -u
where –e option enables IPv4 routing and –u option applies the current configuration to the running system.
# svcadm enable route:default
When you start a routing protocol, the routing daemon /usr/sbin/in.routed automatically updates the routing table, a process that is known as dynamic routing. For more information about the types of routing, see Routing Tables and Routing Types in Configuring and Administering Network Components in Oracle Solaris 11.2 . For information about the routeadm command, see the routeadm (1M) man page and for more information about the ipadm command, see the ipadm (1M) man page.
The Service Management Facility (SMF) Fault Management Resource Identifier (FMRI) associated with the in.routed daemon is svc:/network/routing/route.
This example is based on the following figure.
Router 2 contains two wired network connections, one connection to network 172.20.1.0 and one to network 10.0.5.0. The example shows how to configure a system as a router (Router 2) of the 172.20.1.0 network. The example also assumes that Router 2 has been configured to operate in the local files mode as described in How to Configure a System for Local Files Mode in Configuring and Administering Network Components in Oracle Solaris 11.2 .
Determine the status of the system's interfaces.
# dladm show-link LINK CLASS MTU STATE BRIDGE OVER net0 phys 1500 up -- -- net1 phys 1500 up -- -- net2 phys 1500 up -- -- # ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 10.0.0.1/8 net0/v4 static ok 172.20.1.10/24
Only net0 has been configured with an IP address. To make Router 2 the default router, physically connect the net1 interface to the 10.0.5.0 network.
# ipadm create-ip net1 # ipadm create-addr -a 10.0.5.10/24 net1 # ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 192.168.0.1/8 net0/v4 static ok 172.20.1.10/24 net1/v4 static ok 10.0.5.10/24
Update the following network databases with information about the newly configured interface and the network to which it is connected.
# pfedit /etc/inet/hosts 192.168.0.1 localhost 172.20.1.10 router2 #interface for network 172.20.1 10.0.5.10 router2-out #interface for network 10.0.5 # pfedit /etc/inet/netmasks 172.20.1.0 255.255.255.0 10.0.5.0 255.255.255.0
Enable packet forwarding as well as the in.routed routing daemon.
# ipadm set-prop -p forwarding=on ipv4 # svcadm enable route:default
Now, IPv4 packet forwarding and dynamic routing through RIP are enabled on Router 2. However, to complete the default router configuration for the network 172.20.1.0 you must do the following:
Modify each host on the 172.20.1.0 network so that the host gets its routing information from the new default router. For more information, refer to Creating Persistent (Static) Routes in Configuring and Administering Network Components in Oracle Solaris 11.2 .
Define a static route to the border router in the routing table of Router 2. For more details, refer to Routing Tables and Routing Types in Configuring and Administering Network Components in Oracle Solaris 11.2 . For more information about the ipadm command, see the ipadm (1M) man page.