船体结构与制图:Router OS软路由交流学习站

来源:百度文库 编辑:九乡新闻网 时间:2024/04/29 01:04:08
ROS支持的所有网卡型号(来自ROS官方)
2010年6月4日没有评论
Device Driver List
Document revision: 3.9 (September 26, 2007, 12:55 GMT)
Applies to: V2.9
General Information
Summary
The document lists the drivers, included in MikroTik RouterOS and the devices that are tested to work with MikroTik RouterOS. If a device is not listed here, it does not mean the device is not supported, it still may work. It just means that the device was not tested.
Ethernet
Packages required: system
Description
3Com 509 Series
Chipset type: 3Com 509 Series ISA 10Base
Compatibility:
3Com EtherLink III
3Com FastEtherLink
Chipset type: 3Com 3c590/3c900 (3Com FastEtherLink and FastEtherLink XL) PCI 10/100Base
Compatibility:
3c590 Vortex 10BaseT
3c592 chip
3c595 Vortex 100BaseTX
3c595 Vortex 100BaseT4
3c595 Vortex 100Base-MII
3c597 chip
3Com Vortex
3c900 Boomerang 10BaseT
3c900 Boomerang 10Mbit/s Combo
3c900 Cyclone 10Mbit/s Combo
3c900B-FL Cyclone 10Base-FL
3c905 Boomerang 100BaseTX
3c905 Boomerang 100BaseT4
3c905B Cyclone 100BaseTX
3c905B Cyclone 10/100/BNC
3c905B-FX Cyclone 100BaseFX
3c905C Tornado
3c980 Cyclone
3cSOHO100-TX Hurricane
3CSOHO100B-TX
3c555 Laptop Hurricane
3c575 Boomerang CardBus
3CCFE575 Cyclone CardBus
3CCFE656 Cyclone CardBus
3c575 series CardBus
3Com Boomerang
ADMtek Pegasus
Chipset type: ADMtek Pegasus/Pegasus II USB 10/100BaseT
Compatibility:
Planet 10/100Base-TX USB Ethernet Adapter UE-9500
Linksys Instant EtherFast 10/100 USB Network Adapter USB100TX
AMD PCnet
Chipset type: AMD PCnet/PCnet II ISA/PCI 10BaseT
Compatibility:
AMD PCnet-ISA
AMD PCnet-ISA II
AMD PCnet-PCI II
AMD 79C960 based cards
AMD PCnet32
Chipset type: AMD PCnet32 PCI 10BaseT and 10/100BaseT
Compatibility:
AMD PCnet-PCI
AMD PCnet-32
AMD PCnet-Fast
Broadcom Tigon3
Chipset type: Broadcom Tigon3 PCI 10/100/1000BaseT
Compatibility:
Broadcom Tigon3 570x
Broadcom Tigon3 5782
Broadcom Tigon3 5788
Broadcom Tigon3 5901
Broadcom Tigon3 5901-2
SysKonnect SK-9Dxx Gigabit Ethernet
SysKonnect SK-9Mxx Gigabit Ethernet
Altima AC100x
Altima AC9100
Davicom DM9102
Chipset type: Davicom DM9102 PCI 10/100Base
Compatibility:
Davicom DM9102
Davicom DM9102A
Davicom DM9102A+DM9801
Davicom DM9102A+DM9802
DEC 21x4x ‘Tulip’
Chipset type: DEC 21x4x “Tulip” PCI 10/100Base
Compatibility:
Digital DC21040 Tulip
Digital DC21041 Tulip
Digital DS21140 Tulip
21140A chip
21142 chip
Digital DS21143 Tulip
D-Link DFE 570TX 4-port
Lite-On 82c168 PNIC
Macronix 98713 PMAC
Macronix 98715 PMAC
Macronix 98725 PMAC
ASIX AX88140
Lite-On LC82C115 PNIC-II
ADMtek AN981 Comet
Compex RL100-TX
Intel 21145 Tulip
IMC QuikNic FX
Conexant LANfinity
Intel EtherExpressPro
Chipset type: Intel i82557 “Speedo3″ (Intel EtherExpressPro) PCI 10/100Base
Compatibility:
Intel i82557/i82558/i82559ER/i82801BA-7 EtherExpressPro PCI cards
Intel PRO/1000
Chipset type: Intel i8254x (Intel PRO/1000) PCI 10/100/1000Base
Compatibility:
Intel PRO/1000 Gigabit Server Adapter (i82542, Board IDs: 700262-xxx, 717037-xxx)
Intel PRO/1000 F Server Adapter (i82543, Board IDs: 738640-xxx, A38888-xxx)
Intel PRO/1000 T Server Adapter (i82543, Board IDs: A19845-xxx, A33948-xxx)
Intel PRO/1000 XT Server Adapter (i82544, Board IDs: A51580-xxx)
Intel PRO/1000 XF Server Adapter (i82544, Board IDs: A50484-xxx)
Intel PRO/1000 T Desktop Adapter (i82544, Board IDs: A62947-xxx)
Intel PRO/1000 MT Desktop Adapter (i82540, Board IDs: A78408-xxx, C91016-xxx)
Intel PRO/1000 MT Server Adapter (i82545, Board IDs: A92165-xxx, C31527-xxx)
Intel PRO/1000 MT Dual Port Server Adapter (i82546, Board IDs: A92111-xxx, C29887-xxx)
Intel PRO/1000 MT Quad Port Server Adapter (i82546, Board IDs: C32199-xxx)
Intel PRO/1000 MF Server Adapter (i82545, Board IDs: A91622-xxx, C33915-xxx)
Intel PRO/1000 MF Server Adapter (LX) (i82545, Board IDs: A91624-xxx, C33916-xxx)
Intel PRO/1000 MF Dual Port Server Adapter (i82546, Board IDs: A91620-xxx, C30848-xxx)
Intel PRO/1000 GT Desktop Adapter (i82541PI)
Marvell Yukon
Chipset type: Marvell Yukon 88E80xx PCI 10/100/1000Base
Compatibility:
3Com 3C940 Gigabit LOM Ethernet Adapter
3Com 3C941 Gigabit LOM Ethernet Adapter
Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
Allied Telesyn AT-2970TX Gigabit Ethernet Adapter
Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
Allied Telesyn AT-2971T Gigabit Ethernet Adapter
DGE-530T Gigabit Ethernet Adapter
EG1032 v2 Instant Gigabit Network Adapter
EG1064 v2 Instant Gigabit Network Adapter
Marvell 88E8001 Gigabit LOM Ethernet Adapter
Marvell RDK-80xx Adapter
Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
SK-9521 10/100/1000Base-T Adapter
SK-98xx Gigabit Ethernet Server Adapter
SMC EZ Card 1000
Marvell Yukon 88E8010 based
Marvell Yukon 88E8003 based
Marvell Yukon 88E8001 based
National Semiconductor DP83810
Chipset type: National Semiconductor DP83810 PCI 10/100BaseT
Compatibility:
RouterBoard 200 built-in Ethernet
RouterBoard 24 4-port Ethernet
NS DP8381x-based cards
National Semiconductor DP83820
Chipset type: National Semiconductor DP83820 PCI 10/100/1000BaseT
Compatibility:
Planet ENW-9601T
NS DP8382x-based cards
NE2000 ISA
Chipset type: NE2000 ISA 10Base
Compatibility:
various ISA cards
NE2000 PCI
Chipset type: NE2000 PCI 10Base
Compatibility:
RealTek RTL-8029
Winbond 89C940 and 89C940F
Compex RL2000
KTI ET32P2
NetVin NV5000SC
Via 86C926
SureCom NE34
Holtek HT80232
Holtek HT80229
IMC EtherNic/PCI FO
NS8390
Chipset type: NS8390-compatible PCMCIA/CardBus 10Base
Compatibility:
D-Link DE-660 Ethernet
NE-2000 Compatible PCMCIA Ethernet
NS8390-based PCMCIA cards
RealTek RTL8129
Chipset type: RealTek RTL8129 PCI 10/100Base
Compatibility:
RealTek RTL8129 Fast Ethernet
RealTek RTL8139 Fast Ethernet
RTL8139A/B/C/D chip
RTL8130 chip
RTL8100B chip
SMC1211TX EZCard 10/100 (RealTek RTL8139)
Accton MPX5030 (RealTek RTL8139)
D-Link DFE 538TX
RealTek RTL8169
Chipset type: RealTek RTL8169 PCI 10/100/1000Base
Compatibility:
RealTek RTL8169 Gigabit Ethernet
RouterBOARD 44G
Sundance ST201 ‘Alta’
Chipset type: Sundance ST201 “Alta” PCI 10/100Base
Compatibility:
D-Link DFE-550TX Fast Ethernet Adapter
D-Link DFE-550FX 100Mbps Fiber-optics Adapter
D-Link DFE-580TX 4-port Server Adapter (not recommended: may lock up the system)
D-Link DFE-530TXS Fast Ethernet Adapter
D-Link DL10050-based FAST Ethernet Adapter
Sundance ST201 “Alta” chip
Kendin KS8723 chip
TI ThunderLAN
Chipset type: TI ThunderLAN PCI 10/100Base
Compatibility:
Compaq Netelligent 10 T
Compaq Netelligent 10 T/2
Compaq Netelligent 10/100 TX
Compaq NetFlex-3/P
Olicom OC-2183
Olicom OC-2185
Olicom OC-2325
Olicom OC-2326
VIA vt612x ‘Velocity’
Chipset type: VIA vt612x “Velocity” PCI 10/100/1000Base
Compatibility:
VIA VT6120
VIA VT6121
VIA VT6122
VIA vt86c100 ‘Rhine’
Chipset type: VIA vt86c100 “Rhine” PCI 10/100Base
Compatibility:
VIA Rhine (vt3043)
VIA Rhine II (vt3065 AKA vt86c100)
VIA VT86C100A Rhine
VIA VT6102 Rhine-II
VIA VT6105 Rhine-III
VIA VT6105M Rhine-III
RouterBOARD 44 4-port Fast Ethernet card
D-Link DFE 530TX
Winbond w89c840
Chipset type: Winbond w89c840 PCI 10/100Base
Compatibility:
Winbond W89c840
Compex RL100-ATX
Notes
For ISA cards load the driver by specifying the I/O base address. IRQ is not required.
Wireless
Packages required: wireless
Description
Atheros
Chipset type: Atheros AR5001X PCI/CardBUS 11/54Mbit/s IEEE802.11a/b/g (with wireless AP function)
Compatibility:
Intel 5000 series
Dlink DWL-A520
Dlink DWL-G650
Ubiquity SR5, SR2, SR9 series
Atheros AR5000 chipset series based IEEE802.11a (AR5210 MAC plus AR5110 PHY chips) cards
Atheros AR5001A chipset series based IEEE802.11a (AR5211 MAC plus AR5111 PHY chips) cards
Atheros AR5001X chipset series based IEEE802.11a (AR5211 MAC plus AR5111 PHY chips), IEEE802.11b/g (AR5211 MAC plus AR2111 PHY chips), IEEE802.11a/b/g (AR5211 MAC plus AR5111 and 2111 PHY chips) cards
Atheros AR5001X+ chipset series based IEEE802.11a (AR5212 MAC plus AR5111 PHY chips), IEEE802.11b/g (AR5212 MAC plus AR2111 PHY chips), IEEE802.11a/b/g (AR5212 MAC plus AR5111 and 2111 PHY chips) cards
Atheros AR5002X+ chipset series based IEEE802.11b/g (AR5212 MAC plus AR2112 PHY chips), IEEE802.11a/b/g (AR5212 MAC plus AR5112 PHY chips) cards
Atheros AR5004X+ chipset series based IEEE802.11b/g (AR5213 MAC plus AR2112 PHY chips), IEEE802.11a/b/g (AR5213 MAC plus AR5112 PHY chips) cards
Atheros AR5006X chipset series based IEEE802.11a/b/g (AR5413/AR5414 single-chip devices) cards
Senao NMP-8602 Series cards
Cisco/Aironet
Chipset type: Cisco/Aironet ISA/PCI/PCMCIA 11Mbit/s IEEE802.11b (wireless station only)
Compatibility:
Aironet ISA/PCI/PC4800 2.4GHz DS 11Mbit/s Wireless LAN Adapters (100mW)
Aironet ISA/PCI/PC4500 2.4GHz DS 2Mbit/s Wireless LAN Adapters (100mW)
CISCO AIR-PCI340 2.4GHz DS 11Mbit/s Wireless LAN Adapters (30mW)
CISCO AIR-PCI/PC350/352 2.4GHz DS 11Mbit/s Wireless LAN Adapters (100mW)
Intersil Prism II
Chipset type: Intersil Prism II PCI/CardBUS 11Mbit/s IEEE802.11b (with wireless AP feature)
Compatibility:
Intersil PRISM2 Reference Design 11Mbit/s IEEE802.11b WLAN Card
GemTek WL-211 Wireless LAN PC Card
Compaq iPaq HNW-100 11Mbit/s 802.11b WLAN Card
Samsung SWL2000-N 11Mbit/s 802.11b WLAN Card
Z-Com XI300 11Mbit/s 802.11b WLAN Card
ZoomAir 4100 11Mbit/s 802.11b WLAN Card
Linksys WPC11 11Mbit/s 802.11b WLAN Card
Addtron AWP-100 11Mbit/s 802.11b WLAN Card
D-Link DWL-650 11Mbit/s 802.11b WLAN Card
SMC 2632W 11Mbit/s 802.11b WLAN Card
BroMax Freeport 11Mbit/s 802.11b WLAN Card
Intersil PRISM2 Reference Design 11Mbit/s WLAN Card
Bromax OEM 11Mbit/s 802.11b WLAN Card (Prism 2.5)
corega K.K. Wireless LAN PCC-11
corega K.K. Wireless LAN PCCA-11
CONTEC FLEXSCAN/FX-DDS110-PCC
PLANEX GeoWave/GW-NS110
Ambicom WL1100 11Mbit/s 802.11b WLAN Card
LeArtery SYNCBYAIR 11Mbit/s 802.11b WLAN Card
Intermec MobileLAN 11Mbit/s 802.11b WLAN Card
NETGEAR MA401 11Mbit/s 802.11 WLAN Card
Intersil PRISM Freedom 11Mbit/s 802.11 WLAN Card
OTC Wireless AirEZY 2411-PCC 11Mbit/s 802.11 WLAN Card
Z-Com XI-325HP PCMCIA 200mW Card
Z-Com XI-626 Wireless PCI Card
Notes
If planned to use WEP with Prism cards see link for more information: Wireless Security
Prism cards set in client mode will not connect to Access Points (AP) that work with enabled hide-ssid feature
WaveLAN/ORiNOCO
Chipset type: Lucent/Agere/Proxim WaveLAN/ORiNOCO ISA/PCMCIA 11Mbit/s IEEE802.11b (wireless station only)
Compatibility:
WaveLAN Bronze/Gold/Silver ISA/PCMCIA
Aironet Arlan
Packages required: arlan
Description
This is driver for legacy Aironet Arlan cards, not for newer Cisco/Aironet cards.
Chipset type: Aironet Arlan IC2200 ISA 2Mbit/s 2.4GHz
Compatibility:
Aironet Arlan 655
RadioLAN
Packages required: radiolan
Description
This is driver for legacy RadioLAN cards.
Chipset type: RadioLAN ISA/PCMCIA 10Mbit/s 5.8GHz
Compatibility:
RadioLAN ISA card (Model 101)
RadioLAN PCMCIA card
Synchronous Serial
Packages required: synchronous
Description
FarSync PCI V.35/X.21 (8.448 Mbit/s)
LMC/SBEI wanPCI-1T1E1 PCI T1/E1 (also known as DS1 or LMC1200P, 1.544 Mbit/s or 2.048 Mbit/s)
LMC/SBEI wanPCI-1T3 PCI T3 (also known as DS3, 44.736Mbit/s)
Sangoma S5141 (dual-port) and S5142 (quad-port) PCI RS232/V.35/X.21 (4Mbit/s – primary port and 512Kbit/s – secondary ones)
Asynchronous Serial
Packages required: system
Description
Standard Communication Ports Com1 and Com2
Moxa Smartio C104H/PCI, CP-114, CT-114, CP-132, C168H, CP-168H, and CP-168U PCI 2/4/8 port up to 4 cards (up to 32 ports)
Cyclades Cyclom-Y and Cyclades-Z Series PCI cards up to 64 ports per card, up to 4 cards (up to 256 ports)
TCL DataBooster 4 or 8 PCI 4/8 port cards
Sangoma S514/56 PCI 56 or 64Kbit/s DDS DSU with secondary 128Kbit/s RS232 port (Note: this card is not for modem pools or serial terminals)
ISDN
Packages required: isdn
Description
PCI ISDN cards:
Eicon.Diehl Diva PCI
Sedlbauer Speed Card PCI
ELSA Quickstep 1000PCI
Traverse Technologie NETjet PCI S0 card
Teles PCI
Dr. Neuhaus Niccy PCI
AVM Fritz PCI
Gazel PCI ISDN cards
HFC-2BS0 based PCI cards (TeleInt SA1)
Winbond W6692 based PCI cards
VoIP
Packages required: telephony
Description
H.323 Protocol VoIP Analog Gateways
QuickNet LineJack ISA
QuickNet PhoneJack ISA
Voicetronix V4PCI – 4 analog telephone lines cards
Zaptel X.100P IP telephony card (1 analog line)
xDSL
Packages required: synchronous
Description
Xpeed 300 SDSL cards (up to 6.7km twisted pair wire connection, max 2.3Mbit/s)
HomePNA
Packages required: system
Description
Linksys HomeLink PhoneLine Network Card (up to 10Mbit/s home network over telephone line)
LCD
Packages required: lcd
Description
Crystalfontz Intelligent Serial LCD Module 632 (16×2 characters) and 634 (20×4 characters)
Powertip Character LCD Module PC1602 (16×2 characters), PC1604 (16×4 characters), PC2002 (20×2 characters), PC2004 (20×4 characters), PC2402 (24×2 characters) and PC2404 (24×4 characters)
PCMCIA Adapters
Packages required: system
Description
Vadem VG-469 PCMCIA-ISA adapter (one or two PCMCIA ports)
RICOH PCMCIA-PCI Bridge with R5C475 II or RC476 II chip (one or two PCMCIA ports)
CISCO/Aironet PCMCIA adapter (ISA and PCI versions) for CISCO/Aironet PCMCIA cards only
GPRS Cards
Packages required: wireless
Description
NWH 1600 GPRS Modem (Benq M32 chip)
CDMA/EV-DO Cards
Packages required: system
Description
Audiovox PC5220 CDMA Dual Band 1XEV-DO PC Card for VerizonWireless
Verizon Express Network PC5220 (AirPrime 5220)
Kyocera KPC650 (Verizon Wireless)
Novatel Wireless CDMA card
Novatel U730 (Wireless HSDPA Modem)
Huawei Mobile Connect Model E620 (3G)
Novatel Merlin S720 (HSDPA)
Option G3 PCMCIA card (Vodafone UMTS)
Sierra Aircard 595 and other Sierra Wireless cards
admin默认ros网卡,ROS支持的网卡
ROS动态域名更新脚本设置
2010年4月3日没有评论
首先去www.changeip.com去申请注册一个动态域名帐户和一个免费的域名。
:log info “DDNS: Begin”
:global ddns-user “username“         (这里写申请的帐号)
:global ddns-pass “userpassword“   (这里写密码)
:global ddns-host “username.changeip.net“   (这里写域名)
:global ddns-interface “pppoe-out1“     (这里是外网网卡名称)
:global ddns-system (“mt-” . [/system package get [/system package find name=system] version] )
:global ddns-ip [ /ip address get [/ip address find interface=$ddns-interface] address ]
:if ([ :typeof $ddns-lastip ] = nil ) do={ :global ddns-lastip 0.0.0.0/0 }
:if ([ :typeof $ddns-ip ] = nil ) do={
:log info (“DDNS: No ip address present on ” . $ddns-interface . “, please check.”) } else={
:if ($ddns-ip != $ddns-lastip) do={
:log info “DDNS: Sending UPDATE!”
:log info [ /tool dns-update name=$ddns-host address=[:pick $ddns-ip 0 [:find $ddns-ip "/"] ] key-name=$ddns-user key=$ddns-pass ]
:global ddns-lastip $ddns-ip } else={
:log info “DDNS: No change”
}
}
:log info “DDNS: End”
将上面的脚本复制到winbox中,点击systems—scripts  点+号,打开一页面,把脚本复制进去,进行相关更改设置后点确定,如图示:
ros ddns
再点击systems—scheduler  点+号,设置如图示:
ddns
上面显示是10分钟运行一次,可以自己设定。
最后点确定即可。
adminRouter OS脚本ROS动态域名更新脚本
Routeros安装教程
2010年4月3日没有评论
Routeros安装教程
第一步:安装ROS
放入ROS的光盘到光驱,启动电脑,出再安装画面,按a选择全部安装,再按i开始安装,接下来按n,再按y.安装完毕后会提示你按任意键重启,你按任意键就可以了。
第二步:设置内网的IP
重启ROS后,输入用户名admin,密码为空。然后提示你看注册内容,你不用看就可以了,直接按n就可以了。接下来就进入ROS了。
输入setup,再选择a,再按a,现在出现了一个网卡的名字,不用管它,直接再回车一次,然后输入你想要设置的内网的IP,这里设192.168.3.1/24,输入完后接回车,再选择g,设置网关,切记网关不能设置它自己默认的,要改为0.0.0.0  如下图:
现在设完了,按回车后,输入x回到根目录。
第三步:在客户端用winbox来操作ROS。
设置客户端电脑的IP与ROS先前设置的IP在同一个网段(如:192.168.3.10)
下面打浏览器,在地址栏晨输入192.168.3.1后回车,打开ROS的网页页面,再打开的页面第一项中,点击Download it下载winbox,下载winbox 后打开,输入路由IP,用户名和密码,点connect就进入界面操作了。
现在ROS安装完成,上网的设置请参见本站其它相关内容。
下面是一个视频教程:
',1)">
adminRouter OS安装Router OS安装
2.9.x三线ADSL负载均衡详细配置
2010年4月3日没有评论
ROS三线ADSL负载均衡详细配置:
红色部分自己作相应修改
/ interface pppoe-client
add name=”pppoe-out1″ max-mtu=1480 max-mru=1480 interface=ether1 user=”adsl1帐号” password=”adsl1密码” profile=adsl1gateway service-name=”" ac-name=”" add-default-route=no dial-on-demand=no use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no
add name=”pppoe-out2″ max-mtu=1480 max-mru=1480 interface=ether2 user=”adsl2帐号” password=”adsl2密码” profile=adsl2gateway service-name=”" ac-name=”" add-default-route=no dial-on-demand=no use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no
add name=”pppoe-out3″ max-mtu=1480 max-mru=1480 interface=ether3 user=”adsl3帐号” password=”adsl3密码” profile=default service-name=”" ac-name=”" add-default-route=no dial-on-demand=no use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no
/ ip address
add address=11.1.1.228/32 network=11.1.1.228 broadcast=11.1.1.228 interface=pppoe-out1 comment=”1″ disabled=no
add address=11.1.1.235/32 network=11.1.1.235 broadcast=11.1.1.235 interface=pppoe-out2 comment=”2″ disabled=no
add address=116.116.116.116/32 network=116.116.116.116 broadcast=116.116.116.116 interface=pppoe-out3 comment=”3″ disabled=no
/ ip route
add dst-address=0.0.0.0/0 gateway=11.1.1.228 scope=255 target-scope=10 routing-mark=1 comment=”1″ disabled=no
add dst-address=0.0.0.0/0 gateway=11.1.1.235 scope=255 target-scope=10 routing-mark=2 comment=”2″ disabled=no
add dst-address=0.0.0.0/0 gateway=10.1.1.1 scope=255 target-scope=10 comment=”" disabled=no
add dst-address=0.0.0.0/0 gateway=116.116.116.116 scope=255 target-scope=10 routing-mark=3 comment=”3″ disabled=no
/ ip firewall nat
add chain=srcnat action=masquerade comment=”" disabled=yes
add chain=srcnat src-address=11.1.1.0/24 action=masquerade comment=”" disabled=yes
add chain=srcnat connection-mark=1 action=src-nat to-addresses=11.1.1.228 to-ports=0-65535 comment=”1″ disabled=no
add chain=srcnat connection-mark=2 action=src-nat to-addresses=11.1.1.235 to-ports=0-65535 comment=”2″ disabled=no
add chain=srcnat connection-mark=3 action=src-nat to-addresses=116.116.116.116 to-ports=0-65535 comment=”3″ disabled=no
/ ip firewall mangle
add chain=prerouting dst-address-list=noNTH_IP action=mark-routing new-routing-mark=2 passthrough=yes comment=”noNTH_IP” disabled=no
add chain=prerouting protocol=tcp dst-port=443 action=mark-routing new-routing-mark=1 passthrough=yes comment=”dst.port_443mark1″ disabled=no
add chain=prerouting src-address=11.1.1.0/24 action=mark-routing new-routing-mark=2 passthrough=yes comment=”" disabled=yes
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-state=new nth=2,3,0 dst-address-list=!noNTH_IP action=mark-connection new-connection-mark=1 passthrough=yes comment=”" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-mark=1 dst-address-list=!noNTH_IP action=mark-routing new-routing-mark=1 passthrough=no comment=”" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-state=new nth=2,3,1 dst-address-list=!noNTH_IP action=mark-connection new-connection-mark=2 passthrough=yes comment=”" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-mark=2 dst-address-list=!noNTH_IP action=mark-routing new-routing-mark=2 passthrough=no comment=”" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-state=new nth=2,3,2 dst-address-list=!noNTH_IP action=mark-connection new-connection-mark=3 passthrough=yes comment=”" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-mark=3 dst-address-list=!noNTH_IP action=mark-routing new-routing-mark=3 passthrough=no comment=”" disabled=no
add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1432 comment=”" disabled=no
add chain=prerouting action=accept comment=”" disabled=no
/ ip firewall address-list
add list=noNTH_IP address=202.118.118.0/24 comment=”" disabled=no
add list=noNTH_IP address=222.121.112.51-222.121.112.60 comment=”" disabled=no
/system script
add name=”balance” source={
:local assign-address
:local new-address
:local status
:local x
:set x 3
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=("pppoe-out" . $i)] running]
:if ($status=true) do={
:set new-address [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
:set new-address [:pick $new-address 0 ([:len $new-address] -3)]
:set assign-address [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
:set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
:if ($assign-address != $new-address) do={ /ip address set [/ip address find comment=$i] address=$new-address network=$new-address broadcast=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
/ip firewall nat set [/ip firewall nat find comment=$i] to-addresses=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
}
}
}
}
/ system scheduler
add name=”获取adsl地址” on-event=balance start-date=jan/01/1970 \
start-time=00:00:00 interval=10s comment=”" disabled=no
全部复制到terminal控制台内,之后修改成自己的ADSL帐号、密码;“noNTH_IP”是不需要均衡IP的清单,在/ ip firewall address-list 内修改“noNTH_IP”的实际IP,没有IP可以禁用这个地址清单
adminRouter OS多线路教程ROS三线ADSL负载均衡
RouterOS 3.X nth双线负载均衡
2010年4月3日没有评论
这个例子是双线负载均衡的改进版本。它增加了连续的用户会话,即一个特定用户所有出去的连接使用同一个源IP地址。
值得注意:这篇关于双线NTH负载的设置教程,网上很多都有,都说是2.9.x系列可用,可是为什么还要在这里说呢,因为这个脚本其实是3.x的,不是2.9.x的,不一样的,本人已经尝试过了,是不可以用的,行不通。而且这个NTH负载是奇偶负载,在2.9.x中是没有这个设置项目的。希望大家分别清楚,不要乱用。
配置代码如下:
/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan2
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan1
/ ip firewall mangle
add chain=prerouting in-interface=Local connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing new-routing-mark=odd passthrough=no
add chain=prerouting in-interface=Local connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing new-routing-mark=even passthrough=no
/ ip firewall nat
add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.111.0.2 to-ports=0-65535
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.112.0.2 to-ports=0-65535
/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=odd
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=even
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10
原理与命令讲解
们从所有的连接中,提取每次新建立的连接connection=new,并对他们做nth的标记,将这些连接中相关的奇数(odd)包和偶数(even)包分离开,并走两个不同的网关(GatewayA与GatewayB)出去。这样就能保持每次连接的持续性。
首先我们通过对每段代码做分析,理解他们是怎么运行
IP 配置:
/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan2
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan1
路由器的两个WAN口地址分别是10.111.0.2/24和10.112.0.2/24,LAN口的地址是192.168.0.1/24,内网网卡命名为LOCAL
Mangle配置
下面是通过nth来分配用户连接会话:
/ ip firewall mangle
add chain=prerouting in-interface=Local connection-state=new nth=1,1,0 \
action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing \
new-routing-mark=odd passthrough=no
首先,每隔一个包建立一个新的会话,并用“odd”做标记,因此所有属于同一会话的连续的数据包将被放到标记为odd的连接中,注意,我们将这些数据包传递给第二条和第三条规则(passthrough=yes)。第二条规则在prerouting链表将所有标记属于“odd”的连接放入routing mark的“odd”标记中,并将以上连接在此停止处理。
/ ip firewall mangle
add chain=prerouting in-interface=Local connection-state=new nth=1,1,1 \
action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing \
new-routing-mark=even passthrough=no
这两个规则将剩下的传输做之前的同样处理,并将剩下一半的传输标记为“even”。
NAT配置
/ ip firewall nat
add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.111.0.2 \
to-ports=0-65535
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.112.0.2 \
to-ports=0-65535
被标记为ODD的数据NAT为10.111.0.2,以EVEN为标记的数据NAT为10.112.0.2
路由配置
/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=odd
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=even
被标记为ODD的数据用10.111.0.1为网关,同样,被标记为EVEN的数据从10.112.0.1这个网关出去。
/ ip route
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10
最后,没有做任何标记的数据从10.112.0.2这个网关出去,也是给路由器一个默然网关。
如果是三条或者多条线路的负载均衡则需要修改NTH参数,比如是三条线路的设置修改为: nth=Every,Counter,Packet nth=2,3,0. 2,3,1. 2,3,2 ,共需要在mangle中添加三组规则。而三条以上则以持类推。在3.0中nth参数做了修改,去掉了counter属性,输入的时候我只需要设置Every,Packet两个参数。
adminRouter OS多线路教程ROS负载均衡
ROS单线固定IP上网设置脚本
2010年4月3日没有评论
第一:2.9.x系列脚本
/ip address add address=192.168.1.254/255.255.255.0 interface=lan
/ip address add address=202.96.134.134/255.255.255.248 interface=wan
/ip route add gateway=202.96.134.133
/ip firewall nat add chain=srcnat action=masquerade src-address=192.168.1.0/255.255.255.0
/ip dns set primary-dns=202.96.134.133 secondary-dns=202.96.128.68
/ip firewall mangle add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1440
上面用红色标记出来的是要你自己对应更改的,包括像IP,DNS,网关,内网和外网网卡名,都要按自己设置的来作相应更改。
第二:3.x系列脚本跟上面一样。