cisco 2821路由器配置

作者&投稿:冉该 (若有异议请与网页底部的电邮联系)
思科路由器2821配置代码,怎么配置IP?~

switch> 用户模式
1:进入特权模式 enable
switch>enable
switch#

2:进入全局配置模式 configure terminal
switch>enable
switch#c onfigure terminal
switch(conf)#

3:交换机命名 hostname aptech2950 以aptech2950为例
switch>enable
switch#c onfigure terminal
switch(conf)#hostnameaptch-2950
aptech2950(conf)#

4:配置使能口令 enable password cisco 以cisco为例
switch>enable
switch#c onfigure terminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#enable password cisco

5:配置使能密码 enable secret ciscolab 以cicsolab为例
switch>enable
switch#c onfigure terminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#enable secret ciscolab

6:设置虚拟局域网vlan 1 interface vlan 1
switch>enable
switch#c onfigure terminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#interface vlan 1
aptech2950(conf-if)#ipaddress 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码
aptech2950(conf-if)#noshut 是配置处于运行中
aptech2950(conf-if)#exit
aptech2950(conf)#ipdefault-gateway 192.168.254 设置网关地址

7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例
switch>enable
switch#c onfigure terminal
switch(conf)#hostnameaptch2950
aptech2950(conf)#interface fastehernet 0/17
aptech2950(conf-if)#

8:查看命令 show
switch>enable
switch#show version 察看系统中的所有版本信息
showinterface vlan 1 查看交换机有关ip 协议的配置信息
showrunning-configure 查看交换机当前起作用的配置信息
showinterface fastethernet 0/1 察看交换机1接口具体配置和统计信息
showmac-address-table 查看mac地址表
showmac-address-table aging-time 查看mac地址表自动老化时间

9:交换机恢复出厂默认恢复命令
switch>enable
switch#erase startup-configure
switch#reload



10:双工模式设置
switch>enable
switch#c onfigure terminal
switch2950(conf)#hostnameaptch-2950
aptech2950(conf)#interface fastehernet 0/17 以17端口为例
aptech2950(conf-if)#duplexfull/half/auto 有full , half, auto 三个可选项

11:cdp相关命令
switch>enable
switch#show cdp 查看设备的cdp全局配置信息
show cdpinterface fastethernet 0/17 查看17端口的cdp配置信息
show cdptraffic 查看有关cdp包的统计信息
show cdpnerghbors 列出与设备相连的cisco设备

1,你的nat转换的没有配置
2,你的acl 2的内容没有看到呢

基础配置:
Router# configure terminal——进入全局配置模式
Router(config)# hostname TEST——配置主机名为TEST
TEST(config)# enable secret test——配置密文特权口令为test
TEST(config)# service password-encryption——配置加密口令输出
==========控制台选项==========
TEST(config)# line con 0——进入控制台链路模式
TEST(config-line)# logging synchronous——配置日志输出同步
TEST(config-line)# exec-timeout 0 0——配置控制台超时时间为永不超时
==========远程登录选项==========
TEST(config-line)# line vty 0 4——进入VTY链路模式
TEST(config-line)# login——允许登入
TEST(config-line)# password test——配置远程登录口令为xxx
TEST(config-line)# exit——返回全局配置模式
==========配置IP地址==========
TEST(config)# interface fa0/0——进入fa0/0接口配置模式(本例假设为内网接口)
TEST(config-if)# no shutdown——激活端口
TEST(config-if)# interface fa0/1——进入fa0/1接口配置模式(本例假设为外网接口)
TEST(config-if)# ip address 221.130.40.40 255.255.255.0——配置IP地址和子网掩码(外网)
TEST(config-if)# no shutdown
TEST(config-if)# exit
==========配置DHCP服务==========
TEST(config)# ip dhcp pool TEST1——配置DHCP地址池TEST
TEST(config)# ip dhcp excluded-address 192.168.1.254——配置DHCP排除地址
TEST(config)# ip dhcp excluded-address 192.168.2.254——配置DHCP排除地址
TEST(dhcp-config)# default-router 192.168.1.254——配置默认网关信息
TEST(dhcp-config)# dns-server 202.106.0.20——配置DNS服务器信息
TEST(dhcp-config)# network 192.168.1.0 255.255.255.0——配置DHCP地址池范围
TEST(dhcp-config)# exit
TEST(config)# ip dhcp pool TEST2——配置DHCP地址池TEST
TEST(config)# ip dhcp excluded-address 192.168.2.254——配置DHCP排除地址
TEST(dhcp-config)# default-router 192.168.2.254——配置默认网关信息
TEST(dhcp-config)# dns-server 202.106.0.20——配置DNS服务器信息
TEST(dhcp-config)# network 192.168.2.0 255.255.255.0——配置DHCP地址池范围
TEST(dhcp-config)# exit
==========配置NAT==========
TEST(config)# interface fa0/0.1
TEST(config-if)# ip nat inside——配置NAT内部接口
TEST(config-if)# interface fa0/0.2
TEST(config-if)# ip nat inside
TEST(config-if)# interface fa0/1
TEST(config-if)# ip nat outside——配置NAT外部接口
TEST(config)# access-list 1 permit 192.168.1.0 0.0.0.255——配置访问列表1
TEST(config)# ip nat inside source list 1 interface fa0/1 overload——配置PAT
==========配置静态路由==========
TEST(config)# ip route 0.0.0.0 0.0.0.0 fa0/1——配置静态缺省路由
==========配置单臂路由==========
TEST(config)# interface fa0/0.1——配置子接口1
TEST(config-subif)# encapsulation dot1q 10——为VLAN10封装802.1Q协议
TEST(config-subif)# ip address 192.168.1.254 255.255.255.0——配置子接口地址
TEST(config-subif)# interface fa0/0.2——配置子接口2
TEST(config-subif)# encapsulation dot1q 20——为VLAN20封装802.1Q协议
TEST(config-subif)# ip address 192.168.2.254 255.255.255.0——配置子接口地址
TEST(config-subif)#end——退回至特权模式
TEST# copy running-config startup-config——保存配置文件

以上配置完成后就可以上网、互访了。当然,也可以通过远程对路由器进行访问。
值得注意的是,以上的配置仅仅是商用专线类型的上网,并非家用ADSL的配置;还有,如果需要两个网络通信,还需要增加一台交换机配置VLAN和Trunk。

以上内容均属原创,非转载,非复制粘贴,欢迎楼主继续追问。

en
confi t
hostname 2b
enable password 2b
int f0/0
ip add 192.168.1.1 255.255.255.0
exit
int f0/1
ip add 192.168.2.1 255.255.255.0
exit
# (DHCP配置)
confi t
ip dhcp pool 2B
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
exit
ip dhcp pool SB
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
exit

(两个网络互通)
ip route 192.168.2.0 255.255.255.0 f0/0
ip route 192.168.1.0 255.255.255.0 f0/1
exit
wr这样应该可以了

hostname 2821

enable password cisco

ip dhcp pool cisco10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 202.96.209.5

ip dhcp pool cisco20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 202.96.209.5

interface FastEthernet0/0
description to internet
ip address 202.1.1.1 255.255.255.0
ip nat outside

interface FastEthernet0/1
description to switch
ip nat inside
interface FastEthernet0/1.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
interface FastEthernet0/1.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0

ip nat inside source list 1 interface FastEthernet0/1 overload
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255

line vty 0 4
password cisco
login