路由器的ip routing是缺省启用的,关闭ip routing是为了把路由器当做一台主机来用,所以此时要配上ip default-gateway ,就象在自己的PC上设置缺省网关一样。
有时候会在三层交换机上使用,打开三层交换机的路由功能!
(1)配置三层交换机启动路由功能:ip routing
(2)配置VLAN IP地址: interface vlan vlan-id
Ip address ip-address subnet-mask
No shutdown
(3)配置接口为三层模式: no switchport
(4)配置DHCP中继转发: int vlan vlan-id
Ip helper-address Dhcpserver-address
(5)配置静态路由: ip route targetnet-address netmask nexthop-address
(6)配置RIP协议: router rip
Network netaddress
(7)查看FIB表: show ip cef
(8)查看邻接关系表: show adjacency detail
(9)查看路由表: show ip route
转载于:https://blog.51cto.com/cisco130/911709