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
| Parameter | Description |
|---|---|
-netnum net_number | The 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, |
-nettype {STATIC|DHCP|AUTOCONFIG|MIXED} | Specify the network type: If you specify If you specify If you specify If you specify |
-pingtarget " ping_target_list " | A comma-delimited list of IP addresses or host names to ping. |
-skip | Use this parameter to skip the checking of subnet. |
-verbose | Verbose output. |
Usage Notes
- On Linux and UNIX systems, you must be logged in as the
rootuser 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_NETWORKSdatabase 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
-exportfilespecifies 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
| Parameter | Description |
|---|---|
-netnum network_number | Optionally, 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 If you are changing the network type using the |
-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 Note: This syntax does not support |
-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 ( "" ). |
-skip | Optionally, you can skip the checking of the subnet. |
-verbose | Optionally, 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
rootand 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
staticfor the network type, then you must provide the virtual IP address using thesrvctl add vipcommand. - If you specify
dhcpfor the network type, then the VIP agent obtains the IP address from a DHCP server. - If you specify
autoconfigfor 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
statictomixed, then you must first configure GNS, so that the dynamic addresses obtained can have names registered for them. - If you specify
mixedfor 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_autoconfigfor 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
| Parameter | Description |
|---|---|
-netnum network_number | -all | Specify which network number you want to remove. Alternatively, you can use the -all parameter to indicate that you want to remove all networks. |
-force | Optionally, you can use this parameter to remove the specified network regardless of any dependencies. |
-verbose | Optionally, 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
rootand 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