Assigning an IP address to an Ethernet port
To assign an IP address to port 1/1/1, enter the following commands.
device(config)# interface ethernet 1/1/1 device(config-if-1/1/1)# ip address 10.45.6.1 255.255.255.0
You also can enter the IP address and mask in CIDR format, as follows.
device(config-if-1/1/1)# ip address 10.45.6.1/24
Syntax: no ip address ip- addr ip-mask [ ospf-ignore | ospf-passive | secondary ]
or
Syntax: no ip address ip-addr/mask-bits [ ospf-ignore | ospf-passive | secondary ]
The ospf-ignore and ospf-passive parameters modify the Layer 3 switch defaults for adjacency formation and interface advertisement. Use one of these parameters if you are configuring multiple IP subnet addresses on the interface but you want to prevent OSPF from running on some of the subnets:
- ospf-passive - This option disables adjacency formation with OSPF neighbors. By default, when OSPF is enabled on an interface, the software forms OSPF router adjacencies between each primary IP address on the interface and the OSPF neighbor attached to the interface.
- ospf-ignore - This option disables OSPF adjacency formation and also disables advertisement of the interface into OSPF. The subnet is completely ignored by OSPF.
Use the secondary parameter if you have already configured an IP address within the same subnet on the interface.