Switch(config)#interface vlan 11
Switch(config-if)#ip address 19216811254 2552552550
1 打开思科模拟器软件,找出一台2811类的路由器和两台2960类的交换机,4台PC电脑,并用正确的线缆将各个设备互相连接起来,如下图所示:
2给所有设备都重新命名,路由器命名为r1,一交换机命名为sw1,另一交换机命名为sw2,如下图所示:
3 先配置路由器r1先,配置命令为:
r1(config)#int f0/0
r1(config-if)#no sh
再配置路由器设备的远程登录和密码保护,配置命令为:
r1(config)#lin vty 0 4
r1(config-line)#login local
r1(config-line)#username admin password cisco
r1(config-line)#exit
r1(config)#enable secret cisco
r1(config)#service password-encrption (此命令为加密所有口令)
如下图所示:
4配置交换机sw1,配置命令是:
sw1(config)#int vlan 1
sw1(config-if)#ip add 19216812 2552552550
sw1(config-if)#no sh
sw1(config-if)#ex
sw1(config)#ip default-gateway 19216811
再用相同方法配置sw2,如下图所示:
5 配置vlan设定,在sw1上划分vlan 2,3,将相应端口加入其中,配置命令为:
sw1#conf t
Enter configuration commands, one per line End with CNTL/Z
sw1(config)#vlan 2
sw1(config-vlan)#ex
sw1(config)#vlan 3
sw1(config-vlan)#ex
sw1(config)#int f0/4
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 2
sw1(config-if)#int f0/5
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 3
sw1(config-if)#ex
用相同方法在sw3上面划分vlan,并将相应的端口加入其中,如下图所示:
6配置单臂路由,实现valn1,2,3之间的互访,配置sw1接口f0/1为主干链路,配置命令是:
sw1(config)#int f0/1
sw1(config-if)#switchport mode trunk
sw1(config-if)#no sh
如下图所示:
7在路由器r1上进行封装,配置命令如下图所示:
r1#conf t
Enter configuration commands, one per line End with CNTL/Z
r1(config)#int f0/0
r1(config-if)#no shut
r1(config)#int f0/01
r1(config-subif)#encapsulation dot1Q 1
r1(config-subif)#ip add 19216811 2552552550
r1(config-subif)#ex
r1(config)#int f0/02
r1(config-subif)#encapsulation dot1Q 2
r1(config-subif)#ip add 19216821 2552552550
r1(config-subif)#ex
r1(config)#int f0/03
r1(config-subif)#encapsulation dot1Q 3
r1(config-subif)#ip add 19216831 2552552550
r1(config-subif)#no sh
r1(config-subif)#ex
如下图所示:
8配置DHCP服务器,即是配置路由器r1,配置命令是:
r1#enable
r1#conf t
r1(config)#ip dhcp excluded-address 19216821
r1(config)#ip dhcp pool vlan2
r1(dhcp-config)#net 19216820 2552552550
r1(dhcp-config)#default-router 19216821
r1(dhcp-config)#dns-server 100112
r1(config)#ip dhcp excluded-address 19216831
r1(config)#ip dhcp pool vlan3
r1(dhcp-config)#net 19216830 2552552550
r1(dhcp-config)#dns-server 100112
r1(dhcp-config)#ex
9 现在PC之间可以自动获取IP地址和网关了,如下图所示:
楼主,你好哇~1841路由器配置如下
Router(config)#interface f0/0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#ip address 1721611 2552552550
Router(config-if)#exit
Router(config)#interface f0/1
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#ip address 1721621 2552552550
Router(config-if)#exit
Router(config)#do wr
Building configuration
[OK]
PC0和PC1 ip设置分别设置成
1721612/2552552550 1721613/2552552550
网关为17216811
DNS2021032468
Server服务器 ip分别设置为
1721622/2552552550 1721623/2552552550 1721624/2552552550
网关为17216822
DNS 2021032468
然后测试连通性
我们用PC0去ping 服务器Server0的ip
PC>ping -t 1721622
Pinging 1721622 with 32 bytes of data:
Request timed out
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=0ms TTL=127
Reply from 1721622: bytes=32 time=1ms TTL=127
Ping statistics for 1721622:
Packets: Sent = 12, Received = 11, Lost = 1 (9% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
竟然神奇的通了,配置完成。先用PC机ping网关,如果通,则PC到3层连通的,在用服务器ping网关,能通则说明服务器到三层交换机也是通的,最后在用PC机ping服务器,如果不通,那么检查哈看三层交换机什么地方设置错了1 服务器基本配置
DNS,DHCP,>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)