Шлюз на роутере cisco

Configuring the Switch IP Address and Default Gateway

The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.

Table Of Contents

Configuring the Switch IP Address and Default Gateway

This chapter describes how to configure the IP address, subnet mask, and default gateway on the Catalyst enterprise LAN switches.

Understanding How the Switch Management Interfaces Work

The Catalyst 4500 series, the Catalyst 2948G, Catalyst 2948G-GE-TX, and the Catalyst 2980G switches have three management interfaces:

•In-band interface (sc0)

•SLIP interface (s10)

•Management Ethernet interface (me1)

The in-band (sc0) management interface is connected to the switching fabric and participates in all of the functions of a normal switch port, such as spanning tree, Cisco Discovery Protocol (CDP), and VLAN membership. The out-of-band management interfaces (me1 and sl0) are not connected to the switching fabric and do not participate in any of these functions.

When you configure the IP address, subnet mask, and broadcast address (and when you configure VLAN membership on the sc0 interface) of the sc0 or me1 interface, you can access the switch through Telnet or SNMP. When you configure the SLIP (sl0) interface, you can open a point-to-point connection to the switch through the console port from a workstation.

All IP traffic that is generated by the switch (for example, a Telnet session that is opened from the switch to a host) is forwarded according to the entries in the switch IP routing table. For intersubnetwork communication to occur, you must configure at least one default gateway for the sc0 or me1 interface. The switch IP routing table is used to forward traffic originating on the switch only, not for forwarding traffic sent by devices that are connected to the switch.

Because sc0 and me1 are two distinct interfaces, they potentially can have duplicate IP addresses or overlapping subnets. Therefore, when you enter a command that causes sc0 and me1 to have the same IP address or occupy the same subnet, the switch software brings one of the interfaces down.

Читайте также:  Mts connect 4g wifi роутер

In most cases, the switch software brings down the sc0 interface after you confirm the change. However, when the switch boots with the IP address 0.0.0.0 configured on both the sc0 and me1 interfaces, the me1 interface is brought down to allow BOOTP and RARP requests to broadcast out the sc0 interface.

Note When the switch boots with the IP address 0.0.0.0 configured on both the sc0 and me1 interfaces, the me1 interface is automatically brought down by the switch software. You are not asked to confirm the change, and no console messages or traps are generated in this case.

Duplicate IP addresses and equal subnets are allowed on the sc0 and me1 interfaces if one of the interfaces is configured down. Non-equal subnets are not allowed (for example, sc0 with IP address 10.1.1.1 and subnet mask 255.0.0.0 and me1 with IP address 10.1.1.2 and subnet mask 255.255.255.0).

Understanding How Automatic IP Configuration Works

Automatic IP Configuration Overview

The switch can obtain its IP configuration automatically using one of the following protocols:

•Dynamic Host Configuration Protocol (DHCP)

•Reverse Address Resolution Protocol (RARP)

The switch makes DHCP and RARP requests only if the sc0 interface IP address is set to 0.0.0.0 when the switch boots up. This address is the default for a new switch or a switch whose configuration file has been cleared using the clear config all command. DHCP and RARP requests are only broadcast out the sc0 interface.

Note If the CONFIG_FILE environment variable is set, all configuration files are processed before the switch determines whether to broadcast DHCP and RARP requests. For more information about the CONFIG_FILE environment variable, see Chapter 32, «Modifying the Switch Boot Configuration.»

If both the sc0 and me1 interfaces are unconfigured (IP address 0.0.0.0), the me1 interface is brought down to allow the switch to broadcast requests on the sc0 interface. If the me1 interface is configured and the sc0 interface is not, requests are not sent. Similarly, if the sc0 interface is not configured but the interface is configured down, requests are not sent.

Understanding DHCP

In software release 5.2 and later releases, the switch can obtain an IP address and other IP configuration information using DHCP.

There are three methods for obtaining an IP address from the DHCP server:

•Manual allocation—The network administrator maps the switch MAC address to an IP address at the DHCP server.

•Automatic allocation—The switch obtains an IP address when it first contacts the DHCP server. The address is permanently assigned to the switch.

Читайте также:  Камера к роутеру asus

•Dynamic allocation—The switch obtains a «leased» IP address for a specified period of time. The IP address is revoked at the end of this period, and the switch surrenders the address. The switch must request another IP address.

In addition to the sc0 interface IP address, the switch can obtain the subnet mask, broadcast address, default gateway address, and other information. DHCP-learned values are not used if user-configured values are present.

The switch broadcasts a DHCPDISCOVER message 1 to 10 seconds after all of the switch ports are online. The switch always requests an infinite lease time in the DHCPDISCOVER message.

If a DHCP or Bootstrap Protocol (BOOTP) server responds to the request, the switch takes appropriate action. If a DHCPOFFER message is received from a DCHP server, the switch processes all the supported options that are contained in the message. Table 3-1 shows the supported DHCP options. Other options that are specified in the DHCPOFFER message are ignored.

If a BOOTP response is received from a BOOTP server, the switch sets the in-band (sc0) interface IP address to the address that is specified in the BOOTP response.

If no DHCPOFFER message or BOOTP response is received in reply, the switch rebroadcasts the request using an exponential backoff algorithm (the amount of time between requests increases exponentially). If no response is received after 10 minutes, the sc0 interface IP address remains set to 0.0.0.0 (provided that RARP requests fail as well).

If you reset or power cycle a switch with a DHCP- or BOOTP-obtained IP address, the information learned from DHCP or BOOTP is retained. At boot up, the switch attempts to renew the lease on the IP address. If no reply is received, the switch retains the current IP address.

Understanding RARP

With RARP, you map the switch MAC address to an IP address on the RARP server. The switch retrieves its IP address from the server automatically when it boots up.

The switch broadcasts ten RARP requests after all of the switch ports are online. If a response is received, the switch sets the in-band (sc0) interface IP address to the address that is specified in the RARP response.

If no reply is received, the sc0 interface IP address remains set to 0.0.0.0 (provided that DHCP requests fail as well).

If you reset or power cycle a switch with a RARP-obtained IP address, the information that is learned from RARP is retained.

Preparing to Configure the IP Address and Default Gateway

Before you configure the switch IP address and default gateway, obtain the following information, as appropriate:

•IP address for the switch (sc0 and me1 interfaces only)

Читайте также:  Типилинк роутер настройка роутера tp link

•Subnet mask/number of subnet bits (sc0 and me1 interfaces only)

•(Optional) Broadcast address (sc0 and me1 interfaces only)

•VLAN membership (sc0 interface only)

•SLIP and SLIP destination addresses (sl0 interface only)

•Interface connection type:

–In-band (sc0) interface

Configure this interface when assigning an IP address, subnet mask, and VLAN to the in-band management interface on the switch.

–Out-of-band management Ethernet (me1) interface

Configure this interface when assigning an IP address and subnet mask to the out-of-band management Ethernet interface on the switch.

–SLIP (sl0) interface

Configure this interface when setting up a point-to-point SLIP connection between a terminal and the switch.

Default IP Address and Default Gateway Configuration

Table 3-2 shows the default IP address and default gateway configuration.

Setting the In-Band (sc0) Interface IP Address

Before you can Telnet to the switch or use Simple Network Management Protocol (SNMP) to manage the switch, you must assign an IP address to either the in-band (sc0) logical interface or the management Ethernet (me1) interface.

You can specify the subnet mask (netmask) using the number of subnet bits or using the subnet mask in dotted decimal format.

To set the IP address and VLAN membership of the in-band (sc0) management interface, perform this task in privileged mode:

This example shows how to assign an IP address, specify the number of subnet bits, and specify the VLAN assignment for the in-band (sc0) interface:

Console> (enable) set interface sc0 172.20.52.124/29 
Interface sc0 IP address and netmask set.
Console> (enable) set interface sc0 5 

This example shows how to specify the VLAN assignment, assign an IP address, specify the subnet mask in dotted decimal format, and verify the configuration:

Console> (enable) set interface sc0 5 172.20.52.124/255.255.255.248 
Interface sc0 vlan set, IP address and netmask set.
Console> (enable) show interface 
vlan 5 inet 172.20.52.124 netmask 255.255.255.248 broadcast 172.20.52.17

Setting the Management Ethernet (me1) Interface IP Address

Before you can Telnet to the switch or use SNMP to manage the switch, you must assign an IP address to either the in-band (sc0) logical interface or the management Ethernet (me1) interface. The me1 interface is present only on the Catalyst 4500 series, Catalyst 2948G, Catalyst 2948G-GE-TX, and Catalyst 2980G switches.

You can specify the subnet mask (netmask) using the number of subnet bits or using the subnet mask in dotted decimal format.

To set the management Ethernet (me1) interface IP address, perform this task in privileged mode:

This example shows how to assign an IP address and subnet mask to the management Ethernet (me1) interface and how to verify the interface configuration:

Console> (enable) set interface me1 172.20.52.12/255.255.255.224 
Interface me1 IP address and netmask set.
Console> (enable) show interface 

Источник

Оцените статью
Adblock
detector