交换机
园区网交换机
数据中心与云计算交换机
行业精选交换系列
意图网络指挥官
无线
放装型无线接入点
墙面型无线接入点
智分无线接入点
室外无线接入点
场景化无线
行业精选无线系列
无线管理与应用
功能介绍
4G路由器拨入运营商4G网络,为路由器下的客户端提供互联网服务。
应用场景
1、部分新建小区、或偏远地区,运营商的有线ADSL/PON线路无法到达,可以通过4G网络来访问互联网资源;
2、需要在移动的场景下提供互联网服务(如移动办公、车载WIFI等)。
一、组网需求:
4G路由器下连若干内网用户,4G路由器通过4G拨入互联网为内网用户提供互联网的访问需求。
二、组网拓扑:
三、配置要点:
1、配置路由器拨入4G互联网
2、配置默认路由
3、配置内网服务(内网网关、DHCP)
4、配置NAT策略
四、配置步骤
1、配置路由器拨入4G互联网
4G路由器拨入互联网无需手动配置,设备插入4G卡开机后自动识别4G网络类型,并使用默认APN/账号(APN:cmnet、账号密码:空)自动进行4G拨号。
可通过show ip interface和show cellular info查看4G网络是否拨入成功。
2、配置默认路由
ip route 0.0.0.0 0.0.0.0 cellular 0/0
3、配置4G接口与TRACK联动(建议配置)
ip rns 1
icmp-echo 8.8.8.8 //建议将8.8.8.8探测地址修改为本地互联网DNS地址,减少延时与丢包,链路探测更准确。
frequency 10000 //探测频率为10秒,为提高故障切换速度,可以适当减小
timeout 10000 //探测报文超时时间10秒,为提高故障切换速度,可以适当减小
track 1 rns 1
delay up 30 down 30 //30秒内所有探测报文都不通,则track状态变为down,触发重新拨号;30秒内所有报文都通,则将track状态变为up
exit
interface cellular 0/0
profile create master track 1
注意:配置TRACK联动链路探测,会产生额外的流量费用,具体计算方法如下:
1个icmp request/reply报文大小=100(icmp头+负载)+20(ip头)=120bytes
1个探测周期流量=120(icmp request)+120(icmp reply)=240bytes
探测周期为10秒情况下,探测1天所产生的流量=240*6*60*24=2073600bytes=2.07MB
探测周期为10秒情况下,探测1个月所产生的流量=2.07*30=62.1MB
实际使用时建议配置探测周期为10秒即可
4、配置内网服务(内网网关、DHCP)
(1)配置内网网关
interface vlan 1
ip address 192.168.1.1 255.255.255.0 //配置内网网关IP为192.168.1.1
(2)配置DHCP服务(按需)
enable
configure terminal
service dhcp
ip dhcp pool ruijie
network 192.168.1.0 255.255.255.0
dns-server 8.8.8.8 6.6.6.6 //配置主备DNS,不同运营商不同省份的主备DNS不同。建议与运营商确认后配置本地DNS,确保DNS解析速度。
default-router 192.168.1.1
ip dhcp excluded-address 192.168.1.1
5、配置NAT策略
interface vlan 1
ip nat inside
interface cellular 0/0
ip nat outside
ip access-list standard 10
10 permit 192.168.1.0 0.0.0.255
ip nat inside source list 10 interface cellular 0/0 overload
五、配置验证
1、在3G客户端路由器上通过show ip interface brief可以看到cellular接口能够成功获取到IP地址,并且“status”和“protocol”都为up状态:
Ruijie#show ip interface brief
Interface IP-Address(Pri) IP-Address(Sec) Status Protocol
Cellular 0/0 10.230.7.181/32 no address up up //cellular接口已经获取到IP地址,说明4G拨号成功
2、在路由器上能够正常ping通公网地址
Ruijie#ping 8.8.8.8
Sending 5, 100-byte ICMP Echoes to 192.168.0.111, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
3、路由器内网口接入PC能够自动获取IP地址,并且PC能够正常访问互联网。
六、配置脚本
configure terminal
ip route 0.0.0.0 0.0.0.0 cellular 0/0
ip rns 1
icmp-echo 8.8.8.8
frequency 10000
timeout 10000
track 1 rns 1
delay up 10 down 10
interface cellular 0/0
profile create master track 1
interface vlan 1
ip address 192.168.0.1 255.255.255.0
service dhcp
ip dhcp pool ruijie
network 192.168.0.0 255.255.255.0
dns-server 8.8.8.8 6.6.6.6
default-router 192.168.0.1
ip dhcp excluded-address 192.168.0.1
interface vlan 1
ip nat inside
interface cellular 0/0
ip nat outside
ip access-list standard 10
10 permit 192.168.0.0 0.0.0.255
ip nat inside source list 10 interface cellular 0/0 overload