思科上思科路由器dhcp配置的dhcp怎么设置

思科路由器使用固定IP和PPPOE两种方式上网配置
固定IP上网配置:
&现有客户需要使用思科的2600路由器上网,用户为10M光纤,申请了16个固定IP,IP为61.161.xxx.2-61.161.xxx.14,
默认网关是61.161.xxx.1。内网IP段192.168.1.0,客户要实现192.168.1.50-192.168.1.60之间的IP可以上网,其余的不可以。
&  路由器e0/0接口为WAN外网接口,e0/1为LAN内网接口
& & interface e0/0
&  ip address 61.161.xxx.2 255.255.255.240
//这里可以使用61.161.xxx.2-14个地址中的任意一个,这里就用2
&  ip nat outside
full-duplex
no shutdown
interface e0/1
&&  ip address 192.168.1.1
255.255.255.0
&  ip nat inside
full-duplex
no shutdown
//设置放行的IP地址列表
   access-list 1 permit host 192.168.1.50
& & access-list 1 permit host
192.168.1.51
& & access-list 1 permit host
192.168.1.52
&  access-list 1 permit host 192.168.1.53
&  access-list 1 permit host 192.168.1.54
&  access-list 1 permit host 192.168.1.55
&  access-list 1 permit host 192.168.1.56
access-list 1 permit host 192.168.1.57
   access-list 1 permit host 192.168.1.58
&  access-list 1 permit host 192.168.1.59
&  access-list 1 permit host 192.168.1.60
&  ip nat pool intoout 61.161.xxx.2
61.161.xxx.2 netmask 255.255.255.240
//这里复用61.161.xxx.2的地址,也可以这样写:ip nat pool intoout 61.161.xxx.2
61.161.xxx.14 netmask 255.255.255.252 这样写之后,从地址池里选择任意可用的外网ip
&  ip nat inside source list 1 pool intoout
&  ip route 0.0.0.0 &0.0.0.0
&61.161.xxx.1
&//默认网关,即电信端的地址,下一跳地址。
&  这样配置后就可以上网了,但是客户端必须设置固定IP,配置DNS,如果不配置,因为没有开启DHCP服务,所以必须设置固定IP。
&  如果开启DHCP,则需要这样配置:
&  ip dhcp pool ABC
&  network 192.168.1.0
&  default router 192.168.1.1
&  dns-server 202.96.64.68
  ip dhcp excluded-address 192.168.1.1 需要除去网关的地址,要不就冲突了。
&  如果没有ip的限制,就是单纯的上网,删除那个access-list 1 permit
host 192.168.1.50 至access-list 1 permit host 192.168.1.60
&  增加 access-list 1 permit 192.168.1.0
255.255.255.0就可以了。
PPPOE拨号上网配置:
&对以设置PPPOE上网,以太网接口LAN的配置不变,需要更改外网口WAN的配置和访问控制列表,增加VPDN的配置。假设用户名是admin,密码
123456,配置过程如下:
&  interface e0/1
&  ip address 192.168.1.1 255.255.255.0
&  ip nat inside
&  full-duplex
&  interface
Dialer1&& //建立一个拨号接口
&  ip address negotiated //拨号接口的地址是通过协商获得的
&  ip nat outside
&  encapsulation ppp //封装为ppp协议
&  dialer pool
1&&&&&&&&&&
//建立拨号池为 1
dialer-group
//建立拨号组1 有时候需要设置MTU值比如MTU=1492
&  ppp authentication pap callin
//加密的验证模式为pap,如果是chap,直接更改就可以了。
&  ppp pap sent-username&admin
password 0 123456 //用户名和密码
&  vpdn enable
&  vpdn-group office
&  request-dialin
&  protocol pppoe
&  pppoe enable
&  pppoe-client dial-pool-number 1
&  dialer-list 1 protocol ip permit
&  access-list &1
&permit 192.168.1.0 255.255.255.0
&  ip route &0.0.0.0
&0.0.0.0 &Dialer1
&permanent
&  ip nat inside source list 1 interface
Dialer1 overload
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。稻草人-枫 的BLOG
用户名:稻草人-枫
文章数:64
评论数:195
访问量:309605
注册日期:
阅读量:5863
阅读量:12276
阅读量:355410
阅读量:1052563
51CTO推荐博文
一、拓扑图650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' alt="" src="/attachment/151514.jpg" border="0" />
Router1 F0/0 &----& Switch5 F0/0 Router1 E1/0 &----& VPCS V0/5 Switch5 F0/1 &----& Switch1 F0/0 Switch5 F0/2 &----& Switch2 F0/0 Switch5 F0/3 &----& Switch3 F0/0 Switch5 F0/4 &----& Switch4 F0/0 Switch1 F0/1 &----& VPCS V0/1 Switch2 F0/1 &----& VPCS V0/2 Switch3 F0/1 &----& VPCS V0/3
二、dhcp服务器就是通过主机分配ip的一项服务。路由是通过那个口来分配的。接几个分配几个。要使客户机能从用作DHCP Server的路由器中自动获得IP地址。
三、实验要求:
1、vlan之间的通信通过三层交换机来实现
2、路由器为4个vlan来分配ip地址
3、pc1 - 4分别属于4个部门,能够自动得到ip地址
4、pc1 - 5直接可以ping通
四、实验思路:
1、首先配置二层交换机上的vlan、trunk并把接口加入vlan
2、三层交换中配置vlan、trunk并启用ip routing路由功能
3、三层交换中配置vlan ip地址,三层交换机是带有三层路由功能的交换机,也就是这台交换机的端口既有三层路由功能,也具有二层交换功能。三层交换机端口默认为二层口,如果需要启用三层功能就需要在此端口输入no switchport命令。运行router rip协议(其他协议也行)查看路由表 show ip router
4、配置路由器dhcp服务 建立地址持ip dhcp pool apple(apple为地址池名称可以随便起)运行router rip协议5、保存设置:在全局配置模式下 Router#copy running-config startup-config //保存当前的配置 或 Router#write 也行
五、实验过程:
1、配置二层交换机valn& trunk 并将接口加入vlan
sw1#vlan datasw1#vlan databasesw1(vlan)#vlan 10VLAN 10 added:&&& Name: VLAN0010sw1(vlan)#exitAPPLY completed.Exiting....sw1#conf tEnter configuration commansw1(config)#interface f0/0sw1(config-if)#sw m tsw1(config-if)#interface f0/1sw1(config-if)#sw ac vlan 10sw1(config-if)#exitsw1(config)#exitsw1#show vlan-switch
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' alt="" src="/attachment/101251.jpg" border="0" />
sw2 - 4相同配置
2、配置三层交换(vlan、trunk、vlan ip)
sw3-1#vlan dasw3-1(vlan)#vlan 10VLAN 10 added:&&& Name: VLAN0010sw3-1(vlan)#vlan 20VLAN 20 added:&&& Name: VLAN0020sw3-1(vlan)#vlan 30VLAN 30 added:&&& Name: VLAN0030sw3-1(vlan)#vlan 40VLAN 40 added:&&& Name: VLAN0040
sw3-1(config)#ip routing&&&&&&&& 在三层交换中启动路由功能sw3-1(config)#interface vlan 10sw3-1(config-if)#ip ad 192.168.1.1 255.255.255.0& 配置vlan ipsw3-1(config-if)#no shutsw3-1(config-if)#exitsw3-1(config)#interface vlan 20sw3-1(config-if)#ip ad 192.168.2.1 255.255.255.0sw3-1(config-if)#no& shutsw3-1(config-if)#exitsw3-1(config)#interface vlan 30sw3-1(config-if)#ip address 192.168.3.1 255.255.255.0sw3-1(config-if)#no shutsw3-1(config-if)#interface vlan 40sw3-1(config-if)#ip ad 192.168.4.1 255.255.255.0sw3-1(config-if)#no shutsw3-1(config-if)#exitsw3-1(config)#interface rang f0/1 - 4&&& 配置trunksw3-1(config-if-range)#sw m tsw3-1(config-if-range)#exit
sw3-1(config)#interface f0/0sw3-1(config-if)#no switchport&&& 启动三层接口sw3-1(config)#interface f0/0sw3-1(config-if)#ip address 10.0.0.1 255.0.0.0&&&&&&&& 配置接口ipsw3-1(config-if)#no shut
sw3-1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.3&&&&&&&&&&&& &配置默认路由
sw3-1(config)#router rip&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 启用rip协议sw3-1(config-router)#network 192.168.1.0sw3-1(config-router)#network 192.168.2.0sw3-1(config-router)#network 192.168.3.0sw3-1(config-router)#network 192.168.4.0sw3-1(config-router)#network 10.0.0.0
查看路由表
650) this.width=650;" onclick='window.open("/viewpic.php?refimg=" + this.src)' alt="" src="/attachment/990669.jpg" border="0" />
3、配置dhcp路由器dhcp(config)#interface f0/0dhcp(config-if)#ip addressdhcp(config-if)#ip address 10.0.0.3 255.0.0.0dhcp(config-if)#interface 192.168.237.1 255.255.255.0
dhcp(config)#inte e1/0dhcp(config-if)#ip add 192.168.237.1 255.255.255.0dhcp(config-if)#no shutdhcp(config-if)#exitdhcp(config)#router ripdhcp(config-router)#network 10.0.0.0dhcp(config-router)#network 192.168.237.0
show ip route& 同上
dhcp(config)#ip dhcp pool& apple&&&&&&建立地址池dhcp(dhcp-config)#network 192.168.0.0 255.255.0.0
4、在三层交换指定dhcp服务器即路由器的ip 地址。
sw3-1(config)#interface vlan 10sw3-1(config-if)#ip helper-address 10.0.0.3sw3-1(config-if)#interface vlan 20sw3-1(config-if)#ip helper-address 10.0.0.3sw3-1(config-if)#interface vlan 30sw3-1(config-if)#ip helper-address 10.0.0.3sw3-1(config-if)#inter vlan 40sw3-1(config-if)#ip helper-address 10.0.0.3
5、配置pc5的ip地址为192.168.237.2& 255.255.255.0 gateway 192&.168.237.1
结果:pc5都能ping通pc1 - 4
&本文出自 “” 博客,谢绝转载!
了这篇文章
类别:┆阅读(0)┆评论(0)
15:47:17 12:00:55 17:29:24 17:29:44 09:15:42Cisco路由器的dhcp服务的配置的命令
9:55:57 | 作者: QY003 |
<span id="wppvp_tv_1 次阅读
首先假设两台思科,R1(服务端)连接R2(客户端),组成一个简单的链式局域网,下面就来实现DHCP,配置的命令及其解释如下:
1、R1 dhcp服务的配置
dhcp#configure terminal
//进入全局模式
dhcp(config)#service dhcp
//打开dhcp功能
dhcp(config)#no ip dhcp conflictlogging
//关闭dhcp日志记录
dhcp(config)#ip dhcp pool cisco
//配置dhcp服务器的名称为cisco
dhcp(dhcp-config)#network 192.168.1.0 255.255.255.0
//配置dhcp服务器要分配的网段
dhcp(dhcp-config)#default-router 192.168.1.1
//配置默认网关为192.168.1.1
dhcp(dhcp-config)#dns-server 192.168.1.1
//配置dns服务器为192.168.1.1
dhcp(dhcp-config)#exit
//退出dhcp配置模式
dhcp(config)#ipdhcpexcluded-address 192.168.1.200 192.168.1.254
//配置dhcp不分配的地址
2、R2客户端获取IP地址
Client#configureterminal
//进入全局模式
dhcp(config)#interfacefastethernet0/0
//进入fastethernet0/0接口
dhcp(config-if)#ipaddress dhcp
//从dhcp服务器获取IP地址
本文标题: Cisco路由器的dhcp服务的配置的命令
责任编辑: QY003
服务电话:020-&&&&2011 广东群英网络有限公司 版权所有
增值电信业务经营许可证粤:如何在Cisco思科路由器上配置DHCP _ 路由器设置|192.168.1.1|无线路由器设置|192.168.0.1 - 路饭网
您的位置: >
> 阅读资讯:如何在Cisco思科路由器上配置DHCP
如何在Cisco思科路由器上配置DHCP
这篇文章是关于CISCO路由器作为您的网络中的DHCP服务器来配置。
任务1:配置R1作为一个DHCP服务器,局域网内的主机动态提供所有的网络信息。(R1和R2通过以太网直连)
服务器配置(R1)
!& enable dhcp server (default)
service dhcp
! & defining DHCP pool with all network information
ip dhcp pool OFFICE
network 192.168.12.0 255.255.255.0
domain-name
default-router 192.168.12.1&!& gateway address
dns-server 192.168.12.100 192.168.12.101&!& DNS servers
netbios-name-server 192.168.12.99&!& WINS servers
lease 2&!& lease time
!& defining static binding to R2 using its client-id
ip dhcp pool STATIC
host 192.168.12.2 255.255.255.0
client-identifier 01cc.010d.f000.00
!& exclude server and static addresses from the dynamic pool
ip dhcp excluded-address 192.168.12.1
ip dhcp excluded-address 192.168.12.100 192.168.12.101
ip dhcp excluded-address 192.168.12.200
p dhcp excluded-address 192.168.12.2
客户端配置:
interface FastEthernet0/0
ip address dhcp client-id FastEthernet0/0
从R1 R2得到它的域名动态
!& R2 f0/0 address is assigned via DHCP
R2(config-if)#do sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.12.2 YES&DHCP&up up
!& R1 bindings has R2 as a static entry
R1#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
192.168.12.2 01cc.010d.f000.00 Infinite Manual
R2#sh ip route
Codes: C & connected, S & static, R & RIP, M & mobile, B & BGP
D & EIGRP, EX & EIGRP external, O & OSPF, IA & OSPF inter area
N1 & OSPF NSSA external type 1, N2 & OSPF NSSA external type 2
E1 & OSPF external type 1, E2 & OSPF external type 2
i & IS-IS, su & IS-IS summary, L1 & IS-IS level-1, L2 & IS-IS level-2
ia & IS-IS inter area, * & candidate default, U & per-user static route
o & ODR, P & periodic downloaded static routeGateway of last resort is 192.168.12.1 to network 0.0.0.0
C 192.168.12.0/24 is directly connected, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
S* 0.0.0.0/0 [254/0] via 192.168.12.1
&R2使用浮动静态路由的默认网关设置R1
从R1,R2学习的DNS服务器
R2#Translating &&&domain server (192.168.12.100) (192.168.12.101)
% Unrecognized host or address, or protocol not running.
本文地址:
相关文章列表

我要回帖

更多关于 思科胖ap 设置dhcp 的文章

 

随机推荐