思科路由器配置命令详解及实例
今天给各位分享思科最简单路由配置案例的知识,其中也会对思科路由器配置命令详解及实例进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
1、思科1841路由器最简单的上网配置
2、思科配置单臂路由 举个例子
3、思科三层交换机路由功能配置实例
4、如何配置思科路由器?
思科1841路由器最简单的上网配置
第一步,配置内网的ip地址
第二步,配置外网的IP地址
第三步,配置一个ACL 包含容许上网的IP网段
第四步,配置NAT,把ACL翻译到外网端口,并使用超载。
HXrouter#show run
Building configuration...
Current configuration : 1503 bytes
!
! Last configuration change at 07:41:21 UTC Sat Mar 21 2015 by hailong
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname HXrouter
!
boot-start-marker
boot-end-marker
!
no aaa new-model
ip cef
!
no ip domain lookup
no ipv6 cef
ipv6 multicast rpf use-bgp
!
multilink bundle-name authenticated
!
username hailong privilege 15 password 0 hailong
username cisco privilege 15 password 0 cisco
!
tEthernet0/1
no ip address
media-type rj45
speed auto
duplex auto
negotiation auto
!
interface GigabitEthernet0/2
description *CNC1*
ip address 220.33.76.19 255.255.255.248
ip nat outside
media-type rj45
speed auto
duplex auto
negotiation auto
!
interface GigabitEthernet0/3
ip address 10.10.2.1 255.255.255.0
ip nat inside
media-type rj45
speed auto
duplex auto
negotiation auto
!
ip nat inside source list nat interface GigabitEthernet0/2 overload
ip nat inside source static tcp 192.168.2.104 9080 220.33.76.19 9080 extendable
ip forward-protocol nd
ip http server
no ip http secure-server
!
!
ip route 0.0.0.0 0.0.0.0 220.33.76.17
ip route 192.168.0.0 255.255.0.0 10.10.2.254
!
ip access-list extended nat
permit ip any any
!
!
!
!
control-plane
!
!
line con 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login local
!
!
end
思科配置单臂路由 举个例子
单臂路由
路由器配置:
1设置F0/0接口无IP,开启接口。
interface FastEthernet0/0
no ip address
2在FA0/0接口上设置两个子接口,分别更改封装为DOT1Q,并设置各自的IP地址。
interface FastEthernet0/0.1
encapsulation dot1Q 2
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 3
ip address 2.2.2.1 255.255.255.0
要注意的是这里的VLAN号码要和交换机中的VLAN号对应起来。
交换机配置:
首先在交换机上划分两个VLAN。
Vlan 2 name pc1
Vlan 3 name pc2
1 将交换机连接路由器的接口设置为TRUNK。
interface FastEthernet1/5
switchport mode trunk
!
2 将交换机连接两台PC的接口绑定到不同的VLAN中去。
interface FastEthernet1/11
switchport access vlan 2
!
interface FastEthernet1/12
switchport access vlan 3
PC配置:
给PC的F0/0接口设置与路由器对应子接口同一网段的IP地址。
PC1
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
!
PC2
interface FastEthernet0/0
ip address 2.2.2.2 255.255.255.0
!
给两个PC分别设置一条缺省路由,将出口指向F0/0,即划分入VLAN的接口。
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
至此,单臂路由的实验配置完成。测试的时候在PC1上PING一下PC2,应该可以看到结果。
要点:1,注意子接口的IP要和PC的IP在同一网段。2,要确保所有接口的配置正确,并都打开了接口。3,作为PC使用的路由器上必须配置有正确的路由条目。
例子:
s2960一台,r2811一台,PC2台
SW#vlan database
SW(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
SW(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
SW(vlan)#exit
SW(config)#int f0/2
SW(config-if)#switchport mode access
SW(config-if)#switchport access vlan 2
SW(config-if)#no shutdown
SW(config-if)#int f0/3
SW(config-if)#switchport mode access
SW(config-if)#switchport access vlan 3
SW(config-if)#no shutdown
SW(config-if)#int f0/1
SW(config-if)#switchport mode trunk
SW(config-if)#no shutdown
路由器配置如下:
R(config)#int f0/0
R(config-if)#no shutdown
R(config-if)#int f0/0.2
R(config-subif)#encapsulation dot1q 2
R(config-subif)#ip address 192.168.2.254 255.255.255.0
R(config-subif)#no shutdown
R(config-subif)#int f0/0.3
R(config-subif)#encapsulation dot1q 3
R(config-subif)#ip address 192.168.3.254 255.255.255.0
R(config-subif)#no shutdown
R(config-subif)#end
客户机配置如下:
HostA:
ip:192.168.2.1/24
ip default-gateway:192.168.2.254
HostB:
ip:192.168.3.1/24
ip default-gateway:192.168.3.254
思科三层交换机路由功能配置实例
思科三层交换机路由功能配置实例
普通交换机工作在链路层,即二层交换机,无路由功能,也就是只能同一个网段的机器才能通信。下面是我收集的思科三层交换机路由功能配置实例,希望对你有帮助!
配置23口:
Switch#enable
Switch#configure terminal
Switch(config)#interface fastEthernet 0/23
Switch(config)ip addr 50.1.1.1 255.255.255.0
Switch(config-if)#no switchport
Switch(config-if)#no shutdown
Switch(config-if)#end
类似的配置24口:
Switch#enable
Switch#configure terminal
Switch(config)#interface fastEthernet 0/24
Switch(config)ip addr 60.1.1.1 255.255.255.0
Switch(config-if)#no switchport
Switch(config-if)#no shutdown
Switch(config-if)#end
打开交换机路由转发开关:
Switch#configure terminal
Switch(config)#ip routing
Switch(config)#ip cef (这个默认是打开的)
此时可以查看下23口的状态:
Switch#show interfaces fastEthernet 0/23
此时在交换机上ping两个口的地址成功:
Switch#ping 50.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 50.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Switch#ping 60.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 60.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Switch#
pc1(win7)增加路由:
到60.1.1.0/24的`数据包通过50.1.1.1转发:
route ADD 60.1.1.0 MASK 255.255.255.0 50.1.1.1 METRIC 3
对应的pc2也增加路由:
route ADD 50.1.1.0 MASK 255.255.255.0 60.1.1.1 METRIC 3
此时50.1.1.2和60.1.1.2即可通信。
如果使用了交换机口的路由功能,那么此口(即这里的23,24口)就没有交换能力了。
如果又要交换机有路由功能,又有交换功能,那么交换功能可以由其它口负担。
;
如何配置思科路由器?
1、首先把电源接通,然后插上网线,进线插在wan口,然后跟电脑连接的网线就随便插一个lan口。
2、连接好无线路由器后,在电脑浏览器地址栏输入在路由器IP地址:192.168.1.1。
3、连接后会看到输入相应的登陆用户名:admin,密码:admin。
5、进入设置向导的界面,选择进入上网方式设置。
6、点击下一步,进入上网方式设置,可以看到有三种上网方式。如果是拨号的话那么就用PPPoE。动态IP一般电脑直接插上网络就可以用的,上层有DHCP服务器的。静态IP一般是专线什么的,也可能是小区带宽等,上层没有DHCP服务器的,或想要固定IP的。
7、选择PPPOE拨号上网就要填上网帐号和密码。
8、然后点击下一步后进入到的是无线设置,可以看到信道、模式、安全选项、SSID等等,一般SSID就是一个名字,可以随便填,然后模式大多用11bgn.无线安全选项,要选择wpa-psk/wpa2-psk,这样安全,免得轻意让人家破解而蹭网。点击下一步就设置成功。
9、点击完成,路由器会自动重启,届时就完成了路由器设置工作。
思科最简单路由配置案例的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于思科路由器配置命令详解及实例、思科最简单路由配置案例的信息别忘了在本站进行查找喔。