object-group ip address

Syntax

Syntax to create an IPv4 address object group and enter its context:

object-group ip addressno object-group ip address

Syntax (within the address object-group context) for creating or removing IPv4 address entries:

[][/{|}]no

Description

Creates an IPv4 address object group comprised of one or more address entries. Address groups are used solely as a shorthand way of specifying groups of addresses in the ACEs that make up ACLs. IPv4 address groups can be used only in theaccess-list ipcommand. Enteringobject-group ip addresswith an existing address group name, enables you to modify an existing address group.

Thenoform of this command deletes the entire address group or deletes a particular address group entry identified by sequence number.

Command context

config

Theobject-group ip addresscommand takes you into the named address group context (with promptswitch(config-addrgroup-ip)#) where you enter the addresses.

Parameters

Specifies the address object group name.

Specifies a sequence number for the address entry. Range: 1 to 4294967295. When omitted, a sequence number 10 larger than the current highest sequence number is auto-assigned. Default auto-assigned sequence numbers are 10, 20, 30, and so on.

[/{|}]
Specifies the IPv4 address.
  • - specifies the IPv4 host address.

    • ——指定地址位掩码(CIDR subnet mask notation). Range: 1 to 32.

    • - specifies the address bits to mask (dotted decimal notation).

Authority

Administrators or local user group members with execution rights for this command.

Examples

Creating an IPv4 address group with two entries:

switch(config)#object-group ip address my_ipv4_addr_groupswitch(config-addrgroup-ip)#10 192.168.0.1switch(config-addrgroup-ip)#20 192.168.0.2switch(config-addrgroup-ip)#exitswitch(config)#show object-groupType Name Sequence L4 Port(s)/IP Address ------------------------------------------------------------------------------- IPv4 my_ipv4_addr_group 10 192.168.0.1 20 192.168.0.2

Adding an entry to an existing IPv4 address group:

switch(config)#object-group ip address my_ipv4_addr_groupswitch(config-addrgroup-ip)#30 192.168.0.3switch(config-addrgroup-ip)#exitswitch(config)#show object-groupType Name Sequence L4 Port(s)/IP Address ------------------------------------------------------------------------------- IPv4 my_ipv4_addr_group 10 192.168.0.1 20 192.168.0.2 30 192.168.0.3

Removing an entry (20) from an existing IPv4 address group:

switch(config)#object-group ip address my_ipv4_addr_groupswitch(config-addrgroup-ip)#no 20switch(config-addrgroup-ip)#exitswitch(config)#show object-groupType Name Sequence L4 Port(s)/IP Address ------------------------------------------------------------------------------- IPv4 my_ipv4_addr_group 10 192.168.0.1 30 192.168.0.3

Removing an IPv4 address group:

switch(config)#no object-group ip address my_ipv4_addr_groupswitch(config)#show object-groupNo object group found.