當(dāng)沒有配置路由協(xié)議時,交換機(jī)使用默認(rèn)網(wǎng)關(guān)實(shí)現(xiàn)與其他網(wǎng)絡(luò)的通信。需要注意的是,默認(rèn)網(wǎng)關(guān)必須是直接與交換機(jī)相連接的路由器端口的IP地址,即路由器的LAN端口的IP地址。
Switch# configure terminal 進(jìn)入全局配置模式。
Switch(config)# ip default-gateway IP-address 指定默認(rèn)網(wǎng)關(guān)。
Switch(config)# end
Switch# show ip route 校驗?zāi)J(rèn)網(wǎng)關(guān)設(shè)置。
Switch# copy running-config startup-config