组网技术-路由器
2019-11-06 本文已影响0人
乌云老思
性能和应用 | 特点 |
---|---|
骨干级 | 模块化、热备份、双电源冗余等技术,国家级省级主干网 |
企业级 | 企业网络出入口,可实现数据语音视频等应用 |
接入级 | 边缘路由器,小型企业、部门组网 |
常见端口
- Serial口:高速同步串口,与广域网连接,可连接DDN、帧中继、X.25、PSTN等网络
- Console端口:初次配置控制台端口,利用终端仿真程序对路由器进行本地配置
- RJ-45端口:以太网口,通过双绞线连接局域网,标识ETH或者10/100b TX
- AUX端口:远程配置路由器,连接Modem
路由器接口ip
int g0/0/1 //进入接口
ip add 192.168.1.6 24 //配置IP地址
undo shutdown //开启
dis cu //查看arp
静态路由
ip route-static 192.168.20.0 24 10.0.12.2 //下一跳IP
ip route-static 192.168.10.0 24 serial0/0/1 //下一跳接口
ip route-static 0.0.0.0 0 192.168.1.5 //默认路由
display ip routing-table
RIP协议
rip //启用rip,默认v1
network 192.168.1.0 //发布直连网段
version 2 //发布为v2版本
dis rip //查看rip
dis rip database //查看rip数据库
dis ip routing-table //查看路由表
优先级:直连0,静态60,rip100,ospf10/150
DHCP配置
//基于全局的DHCP:
dhcp enable //开启DHCP
ip pool dizhichi //地址池名称
network 192.168.1.0 //地址池
lease day 2 //默认租约是1
gateway-list 192.168.1.254
excluded-ip-address 192.168.1.250 192.168.1.253 //排除的IP范围
dns-list 8.8.8.8 //DNS服务器
dhcp select global //基于全局
//基于接口的DHCP:
dhcp enable /开启dhcp
int g0/0/1 //进入接口
dhcp select interface //基于接口模式
dhcp server lease day 2 //默认租约为1
dhcp server excluded-ip-address 192.168.1.1 192.168.1.10 //排除的IP范围
dhcp server dns-list 8.8.8.8 //dns
dis ip pool //查看dhcp
ACL配置
acl 2000 //配置基本acl,2000~2999,默认是IP协议
rule 5 permit source 1.1.1.1 0//允许访问的源地址,反掩码0,默认步长5
rule 10 deny any //拒绝其他
user-interface vty 0 4 //进入虚拟口
acl 2000 inbound //应用acl
dis acl all /查看acl
dis acl 2000
acl 3000 //配置高级acl,3000~3999,需要指定IP协议和目的地址
rule permit ip source 1.1.1.1 0 destination 4.4.4.4 0 //允许访问的源地址和目的地址
user-interface vty 0 4 //虚拟接口
acl 3000 outbound //应用acl
int g0/0/1 //进入物理接口
traffic-filter inbound acl 3000 //应用acl
dis acl all //查看所有acl
NAT配置
//多对少:
nat address-group 1 202.169.20.50 202.169.20.60 //外部地址
acl 2001 //配置ACL
rule 5 permit source 172.17.1.0 0.0.0.255 //内部IP
int g0/0/1
nat outbound 2001 address-group 1 no-pat
dis net outbound
//一对一:
int g0/0/1
nat static global 202.169.10.5 inside 172.16.1.1 //一对一转换
ipv6overipv4GRE隧道
#第一步,配置ip地址,开启ipv6
sys
sys r1
int g1/0/0
ip add 10.1.1.1 24
quit
ipv6 //全局开启ipv6
int g2/0/0
ipv6 en //接口开启ipv6
ipv6 add fc01::1 64
quit
#第二步,r1\r2配置静态路由
ip route-static 10.1.2.2 24 10.1.1.2
ip route-static 10.1.1.1 24 10.1.2.1
#第三步,配置Tunnel接口
int tunnel 0/0/1
tunnel-protocol gre
ipv6 en
ipv6 add fc02::1 64
#第四步,配置r1\r2的Tunnel静态路由
ipv6 route-static fc03::1 64 tunnel 0/0/1
ipv6 route-static fc01::1 64 tunnel 0/0/1
#第五步,验证检查结果
ping 10.1.1.1
ping ipv6 fc01::1
ipv6的ISATAP隧道
#第一步,配置路由器接口IP、双栈
int tunnel 0/0/2
tunnel-protocol ipv6-ipv4 isatap
ipv6 en
ipv6 add 2001::/64 eui-64
undo ipv6 nd ra halt
#第二步,配置isatap主机,在电脑上配置
netsh int ipv6 isatap set router 2.1.1.1
netsh int ipv6 isatap set router 2.1.1.1 enable