思科路由器静态路由表的配置

来源:互联网 发布:java 数组 length 编辑:程序博客网 时间:2024/04/30 01:39

首先将网段合理分配,如下是一个实验例子。

我们要实现的是对router0和router1的静态路由表的配置,具体配置步骤如下:

router0:

Router>en 

Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.0.2 255.255.255.0
Router(config-if)#no sh

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

Router(config-if)#exi
Router(config)#int f0/1
Router(config-if)#ip add 10.1.5.2 255.255.255.0
Router(config-if)#no sh

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

Router(config-if)#exi
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config)#ip route 10.1.5.0 255.255.255.0 f0/1
Router(config)#ip route 192.168.1.0 255.255.255.0 f0/1

router1

Router>en
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 10.1.5.1 255.255.255.0
Router(config-if)#no sh u

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
Router(config-if)#exi
Router(config)#int f0/1
Router(config-if)#ip add 192.168.1.2
% Incomplete command.
Router(config-if)#ip add 192.168.1.2 255.255.255.0
Router(config-if)#no shu 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

Router(config-if)#exi
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%SYS-5-CONFIG_I: Configured from console by console
Router#confi t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.0.0 255.255.255.0 f0/0
Router(config)#ip route 10.1.5.0 255.255.255.0 f0/0

按照上述的步骤配置完成后,可以在pc0上面执行ping命令:

ping 192.168.1.1

发现能ping通,说明配置成功

原创粉丝点击