ROS_网吧电信光纤固定IP网关网通ADSL动态IP网关(双线)Suitable for optical fiber with ADSL (zero dropped night can Telecom Netcom supplemented)
I am from the online tutorials, compared with the test, walked a lot of detours, and try to make the script simple and practical.
Telecommunications fiber optic data are as follows:
IP address: 111. 111. 111. 111/30
Gateway address: 111. 111. 111. 112
Network Name: CTC
CNC ADSL data:
Account number: ADSL
P as swor d: XXXXXX
Network Name: CNC
LAN data:
Routing intranet IP (intranet gateway) : 192. 168.0. 1/24Network Name: LAN
ROS installation (Baidu, yeah, everywhere)
Impl ementation
1, in/ip address configuration network IP, fiber optic Telecom IP
/ IP address
Add, address=192. 168.0. 1/24, interface=lan, comment=, "Lan""Add, address=111. 111. 111. 111/30, interface=ctc, comment=,"CTC""
2, configure the ADSL line
/interface pppoe-client configure ADSL dialing information.Let ADSL pull it up
/interface pppoe-client
Add, name=pppoe-out1, interface=cnc, user=adsl,password=xxxxxx
After ROS dial-up success, you will get ADSL dynamic IP and dynamic gateway, access to the gateway is ip->address in the interface=pppoe-out1 network entries.
For example, the dial up IP is the address gateway in
222.222.222.223 and the 222. 222.222. 221 in the network
3. configure IP camouflage (shared Internet access)
/ip, firewall, src-nat, add, action, masquerade
4. conf igure routing (Gateway)
Default Telecom gateway 111. 111. 111. 112
The gateway for marking telecommunication is "CTC". The gateway of CNC is "CNC", and the standby gateway is "ADSL" (used when switching lines)
CNC gateway casually add anti ADSL drop line, the foot has been automatically modified it
/ IP route
Add, dst-address=0.0.0.0/0, gateway=111. 111. 111. 112,comment=, "CTC""
Add, dst-address=0.0.0.0/0, gateway=222.222.222. 221,comment=, CNC, check-gateway=ping, rout ing-mark=cnc
Add, dst-address=0.0.0.0/0, gateway=222.222.222. 221,comment=, "ADSL", disable=yes
5. add CNC routing table.
Chengdu network (cnc1n.rsc download address:http://www.mikrotik.com.cn/down.asp in MikroTik RouterOS 2.9new telecommunications network script download)
The routing table is now more route rule add rules, the resource occupation is relatively small, previously added directly in /route requires each rule to enable the check-gateway function,repeat too much operation. Now only one gateway rule opens the check-gateway function to implement gateway detection and reduces the operation step.
Fix and add some new telecom and CNC addresses.
Six
Added ADSL to automatically switch the gateway' s task (to prevent ADSL from dropping scripts)
(take the IP address dynamic (Network) gateway to modify the gateway in IP route)
: local oldip
: local newip
Set newip, [/ip, address, [/ip, get, address, find, dynamic=yes,interface=pppoe-out 1] network]
Set, oldip, [/ip, route, get, [/ip, route, find, comment=cnc],gateway]
: if ($newip = = $oldip) do={
/ip, route, set, [/ip, route, f ind, comment=cnc] ,gateway=$newi p
}
Dynamic=yes (ADSL runs strong) dynamic=no (ADSL does not run strong)
Now you can access Telecom, Telecom Access, CNC Netcom
7. after the automatic switching optical fiber telecommunications dropped into the ADSL line (by night)Netcom Configuration / tool netwatch is used to monitor the on-off of the network
/ tool netwatch
Add, host=111. 111. 111. 112, timeout=1s, interval=1m,up-script=dxup, down-script=dxdown
Add the following script
Dxup (Telecom on line)
Dxdown (Telecom drop line)
Dxup (Telecom on line)
/ip, route, disable, [/ip, route, find, comment=adsl]/ip, route, enable, [/ip, route, f ind, comment=ctc]
/ip, route, enable, [/ip, route, f ind, comment=cnc]
Dxdown (Telecom drop line)
: local adslwg
: set, adslwg, [/ip, address, get, [/ip, address, f ind, ,dynamic=yes, interface=pppoe-out1] , network]
/ip, route, set, [/ip, route, f ind, comment=adsl],gateway=$adslwg
/ip, route, disable, [/ip, route, find, comment=ctc]
/ip, route, disable, [/ip, route, find, comment=cnc]
/ip, route, enable, [/ip, route, f ind, comment=adsl]
Enable enable disable disable (stop) remove removal
Disable=no enable disable=yes disable
The disable=no command means "no". "NO" stands for not prohibiting YES from importing the script, but it is forbidden and does not enable him
The principle of optical fiber and ADSL line switch is automatically disabled when the fiber dropped after routing and Netcom ADSL fiber-optic telecommunications shunting route,activate standby Netcom ADSL (single) (dynamic routing gateway script will automatically detect) . When the fiber recovery
after the disable Netcom ADSL standby (single) routing, enable Telecom and Netcom shunt the routing.
8. fill in DNS
The first method: IP--DNS--Settings, Primary, DNS, Tim Telecom,DNS, Seconday, DNS, Tim Netcom, the main DNS
Hit the hook on the Allow Remote Requests. If you don't hit it,it' s going to go wrong,
The client' s DNS fills the ROS intranet IP
Second methods:
Client preferred DNS Tim Telecom DNS
Spare DNS Tim Netcom DNS
企鹅小屋怎么样?企鹅小屋最近针对自己的美国cn2 gia套餐推出了2个优惠码:月付7折和年付6折,独享CPU,100%性能,三网回程CN2 GIA网络,100Mbps峰值带宽,用完优惠码1G内存套餐是年付240元,线路方面三网回程CN2 GIA。如果新购IP不能正常使用,请在开通时间60分钟内工单VPS技术部门更换正常IP;特价主机不支持退款。点击进入:企鹅小屋官网地址企鹅小屋优惠码:年付6折优惠...
易探云怎么样?易探云香港云服务器比较有优势,他家香港BGP+CN2口碑不错,速度也很稳定。尤其是今年他们动作很大,推出的香港云服务器有4个可用区价格低至18元起,试用过一个月的用户基本会续费,如果年付的话还可以享受8.5折或秒杀价格。今天,云服务器网(yuntue.com)小编推荐一下易探云国内云服务器优惠活动,北京和深圳这二个机房的云服务器2核2G5M带宽低至330.66元/年,还有高配云服务器...
数脉科技(shuhost)8月促销:香港独立服务器,自营BGP、CN2+BGP、阿里云线路,新客立减400港币/月,老用户按照优惠码减免!香港服务器带宽可选10Mbps、30Mbps、50Mbps、100Mbps带宽,支持中文本Windows、Linux等系统。数脉香港特价阿里云10MbpsCN2,e3-1230v2,16G内存,1T HDD 或 240G SSD,10Mbps带宽,IPv41个,...