Network Commands

Use commands with the network keyword to add, modify, list the configuration of, and remove a non-default Network.

srvctl add network

Adds a static or dynamic network.

If your server connects to more than one network, then you can use this command to configure an additional network interface for Oracle RAC, allowing you to create VIPs on multiple public networks.

Syntax

srvctl add network [-netnum net_number] -subnet subnet/netmask[/if1[|if2...]]
   [-nettype {STATIC | DHCP | AUTOCONFIG | MIXED}] [-pingtarget "ping_target_list"]
   [-skip] [-verbose]

Parameters

Table: srvctl add network Command Parameters

ParameterDescription
-netnum net_numberThe network number. The default is 1.
-subnet subnet / netmask [/ if1 [| if2 |...]]

Defines a subnet. If you do not specify any interface names, then the network uses any interface on the given subnet.

For IPv6, netmask is a prefix length, such as 64.

-nettype {STATIC|DHCP|AUTOCONFIG|MIXED}

Specify the network type: STATIC, DHCP, AUTOCONFIG, or MIXED.

If you specify STATIC for the network type, then you must provide the virtual IP address using the srvctl add vip command.

If you specify DHCP for the network type, then the VIP agent obtains the IP address from a DHCP server.

If you specify AUTOCONFIG for the network type, then the VIP agent generates a stateless IPv6 address for the network. You can only use AUTOCONFIG for IPv6 networks. If the subnet/netmask specification is not for an IPv6 address, then SRVCTL returns an error.

If you specify MIXED for the network type, then the VIP resource uses both a static IP address and an IP address obtained dynamically, either from a DHCP server for IPv4 or using stateless auto-configuration for IPv6.

-pingtarget " ping_target_list "A comma-delimited list of IP addresses or host names to ping.
-skipUse this parameter to skip the checking of subnet.
-verboseVerbose output.

Usage Notes

  • On Linux and UNIX systems, you must be logged in as the root user and on Windows, you must be logged in as a user with Administrator privileges to run this command.
  • This command is only available with Oracle Clusterware.
  • Oracle only supports DHCP-assigned networks for the default network, not for subsequent networks.
  • You can also use the LISTENER_NETWORKS database initialization parameter to control client redirects to the appropriate network.

Example

An example of this command is:

# srvctl add network -netnum 3 -subnet 192.168.3.0/255.255.255.0

srvctl config network

Displays the network configuration for the cluster.

Syntax

srvctl config network [-netnum network_number] [-exportfile file_name]

Usage Notes

  • Specify the network for which you want to display configuration information.
  • This command is only available with Oracle Clusterware.
  • The -exportfile specifies the output file to which the resource configuration will be exported in JSON format for backup or resource re-creation purposes.

Example

An example of this command is:

$ srvctl config network -netnum 2

srvctl modify network

Modifies the subnet, network type, or IP address type for a network in Oracle Clusterware.

Syntax

srvctl modify network [-netnum network_number] [-subnet subnet1/netmask1[/if1[|if2...]]
[,subnet2/netmask2[/if1[|if2...]]]] [-nettype {STATIC|DHCP|AUTOCONFIG|MIXED}] [-iptype {ipv4 | ipv6 | both}]
[-pingtarget "ping_target_list"] [-skip] [-verbose]

Parameters

Table: srvctl modify network Command Parameters

ParameterDescription
-netnum network_numberOptionally, you can specify a network number that you want to modify. The default is 1.
-subnet subnet/netmask[/if1[|if2|...]]

Optionally, you can specify a subnet number for the public network. The netmask and interfaces you specify, if any, change those of the network you are modifying. If you specify an IPv6 subnet, then enter a prefix length, such as 64, in place of netmask. If you do not specify any interface names, then the VIPs use any interface on the given subnet.

If you are changing the network type using the -nettype parameter, then you must specify either an existing IPv4 or IPv6 network using the -subnet parameter. Additionally, the subnet and netmask you specify in the -subnet parameter do not change those of the network you are modifying.

-subnet subnet1 / netmask1 [/ if1 [| if2 ...]], subnet2 / netmask2 [/ if1 [| if2 ...]]

Use this syntax with two subnets to add a new subnet of the same IP protocol family to an existing static network.

The subnet1 and netmask1 must match the current network subnet and netmask, subnet2 and netmask2 are for the new subnet.

Note: This syntax does not support -iptype and -nettype arguments.

-nettype {STATIC|DHCP|AUTOCONFIG|MIXED}Optionally, you can modify the network type using this parameter, to static , dhcp , autoconfig , or mixed .
-iptype {ipv4 | ipv6 | both}Alternative to modifying the network type, you can modify the IP address type to ipv4, ipv6, or both.
-pingtarget " ping_target_list "Optionally, you can specify a comma-delimited list of IP addresses or host names to ping enclosed in double quotation marks ( "" ).
-skipOptionally, you can skip the checking of the subnet.
-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

  • You can only use this command with Oracle Clusterware.
  • On Linux and UNIX systems, you must be logged in as root and on Windows, you must be logged in as a user with Administrator privileges to run this command.
  • You can modify the IP address type for a network from IPv4 to IPv6, or from IPv6 to IPv4.
  • If you specify static for the network type, then you must provide the virtual IP address using the srvctl add vip command.
  • If you specify dhcp for the network type, then the VIP agent obtains the IP address from a DHCP server.
  • If you specify autoconfig for the network type, then the VIP agent generates a stateless IPv6 address for the network. You can only use this parameter for IPv6 networks. If the subnet/netmask specification is not for an IPv6 address, then SRVCTL returns an error.
  • If you change a network from static to mixed , then you must first configure GNS, so that the dynamic addresses obtained can have names registered for them.
  • If you specify mixed for the network type, then the VIP resource uses both a static IP address and an IP address obtained dynamically, either DHCP or autoconfig.
  • If you specify mixed_autoconfig for the network type, then the VIP resource retains the static IP configuration and either obtains an IP address from a DHCP server for an IPv4 network specification or generates a stateless auto-configured IP address for an IPv6 network specification.

Examples

The following example changes the subnet number, netmask, and interface list:

# srvctl modify network -subnet 192.168.2.0/255.255.255.0/eth0

The following example changes the second network to DHCP:

# srvctl modify network -netnum 2 -nettype dhcp

The following example adds an IPv6 subnet and netmask to the default network:

# srvctl modify network -subnet 2606:b400:400:18c0::/64

The following example removes the IPv4 configuration from a network:

# srvctl modify network -iptype ipv6

Related Topics

srvctl predict network

Predicts the consequences of network failure.

Syntax

srvctl predict network [-netnum network_number] [-verbose]

Usage Notes

Optionally, you can specify a network for which you want to evaluate a failure. The default value is 1. You can also use the -verbose parameter to print detailed output.

Example

The following example predicts the consequences of a failure on network number 2:

$ srvctl predict network -netnum 2

srvctl remove network

Removes the network configuration.

Syntax

srvctl remove network {-netnum network_number | -all} [-force] [-verbose]

Parameters

Table: srvctl remove network Command Parameters

ParameterDescription
-netnum network_number | -allSpecify which network number you want to remove. Alternatively, you can use the -all parameter to indicate that you want to remove all networks.
-forceOptionally, you can use this parameter to remove the specified network regardless of any dependencies.
-verboseOptionally, you can use this parameter to display detailed output.

Usage Notes

  • You can only use the command with Oracle Clusterware.
  • You must have full administrative privileges to run this command. On Linux and UNIX systems, you must be logged in as root and on Windows systems, you must be logged in as a user with Administrator privileges.

Example

The following example removes a network:

# srvctl remove network -netnum 3