Refer to How to Configure an IPv4 Interface.
# routeadm -p ipv4-forwarding persistent=enabled default=disabled current=enabled # routeadm -d ipv4-forwarding -u # routeadm -p ipv4-forwarding persistent=disabled default=disabled current=disabled
# routeadm -e ipv4-routing -u # routeadm -p ipv4-routing persistent=enabled default=enabled current=enabled
The following example shows how to configure a multihomed host, as illustrated in the figure in IPv4 Autonomous System Topology in Planning for Network Deployment in Oracle Solaris 11.2 . In this example, the system has the host name hostc. This host has two interfaces, which are both connected to network 192.168.5.0.
To begin, you would display the status of the system's interfaces.
# dladm show-link LINK CLASS MTU STATE BRIDGE OVER net0 phys 1500 up -- -- net1 phys 1500 up -- -- # ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 net0/v4 static ok 192.168.5.82/24
The dladm show-link command reports that hostc has two datalinks. However, only net0 has been configured with an IP address. To configure hostc as a multihomed host, you would configure net1 with an IP address in the same 192.168.5.0 network. Ensure that the underlying physical NIC of net1 is physically connected to the network.
# ipadm create-ip net1 # ipadm create-addr static -a 192.168.5.85/24 net1 # ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 net0/v4 static ok 192.168.5.82/24 net1/v4 static ok 192.168.5.85/24
Next, you would add the net1 interface to the /etc/hosts file as follows:
# vi /etc/inet/hosts 127.0.0.1 localhost 192.168.5.82 hostc #primary network interface for host3 192.168.5.85 hostc-2 #second interface
Then, you would turn off packet forwarding if this service is running on the hostc as follows:
# routeadm -p ipv4-forwarding persistent=enabled default=disabled current=enabled # routeadm Configuration Current Current Option Configuration System State --------------------------------------------------------------- IPv4 routing enabled enabled IPv6 routing disabled disabled IPv4 forwarding disabled disabled IPv6 forwarding disabled disabled Routing services "route:default ripng:default" Routing daemons: STATE FMRI disabled svc:/network/routing/ripng:default online svc:/network/routing/ndp:default disabled svc:/network/routing/rdisc:default disabled svc:/network/routing/legacy-routing:ipv4 disabled svc:/network/routing/legacy-routing:ipv6 online svc:/network/routing/route:default
The routeadm command reports that dynamic routing through the in.routed daemon is currently enabled.