当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > routeros端口映射方法

Linux服务器
中小企业服务器配置-邮件服务器(1)
中小企业服务器配置-邮件服务器(2)
典型WEB服务器Apache高级设置指南
从HTTP服务器状态代码分析
基于反向代理的Web缓存加速现代理服务器
在ApacheHTTPD服务器中使用DSO完全分析
组网不求人!搭建简易Linux局网服务器
基于NUMA架构的高性能服务器技术(1)
基于NUMA架构的高性能服务器技术(2)
复制另一台Linux服务器及相关问题
Linux服务器之间怎么样SSH不需密码
Rsync在服务器间镜像或者备份目录
服务器诊所:鲜为人知但很有用的观念
服务器诊所:并不是仅仅就是线程化而已
服务器诊所:PDF自动生成专业质量输出
用低代价的服务器过程将文档处理自动化
设置一个企业级的LinuxPOP3服务器
WEB服务器Apache编译指南及高级技巧
给Qmail邮件服务器加个病毒防火墙
LinuxCVS服务器与WinCVS的配置与使用

Linux服务器 中的 routeros端口映射方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 54 ::
收藏到网摘: n/a

参与的routeros是2块网卡,ether1连接adsl,做pppoeclient,ether2连接局域网。
首先按照论坛上置顶的说明正确安装并配置routeros,实现客户机能够正常上网。
然后terminalrouteros

改变www服务端口为8081:
/ipservicesetwwwport=8081

改变hotspot服务端口为80,为用户登录页面做准备:
/ipservicesethotspotport=80


Setuphotspotprofiletomarkauthenticateduserswithflowname"hs-auth":
/iphotspotprofilesetdefaultmark-flow="hs-auth"login-method=enabled-address

增加一个用户:
/iphotspotuseraddname=user1password=1


重定向所有未授权用户的tcp请求到hotspot服务
/ipfirewalldst-nataddin-interface="ether2"flow="!hs-auth"protocol=tcpaction=redirect
to-dst-port=80comment="redirectunauthorizedclientstohotspotservice"


允许dns请求、icmpping;拒绝其他未经认证的所有请求:
/ipfirewalladdname=hotspot-tempcomment="limitunauthorizedhotspotclients"

/ipfirewallruleforwardaddin-interface=ether2action=jump
jump-target=hotspot-tempcomment="limitaccessforunauthorizedhotspotclients"

/ipfirewallruleinputaddin-interface=ether2dst-port=80protocol=tcp
action=acceptcomment="acceptrequestsforhotspotservlet"

/ipfirewallruleinputaddin-interface=ether2dst-port=67protocol=udp
action=acceptcomment="acceptrequestsforlocalDHCPserver"

/ipfirewallruleinputaddin-interface=ether2action=jump
jump-target=hotspot-tempcomment="limitaccessforunauthorizedhotspotclients"
/ipfirewallrulehotspot-tempaddflow="hs-auth"action=return
comment="returnifconnectionisauthorized"

/ipfirewallrulehotspot-tempaddprotocol=icmpaction=return
comment="allowpingrequests"

/ipfirewallrulehotspot-tempaddprotocol=udpdst-port=53action=return
comment="allowdnsrequests"

/ipfirewallrulehotspot-tempaddaction=reject
comment="rejectaccessforunauthorizedclients"

创建hotspot通道给认证后的hotspot用户
Createhotspotchainforauthorizedhotspotclients:
/ipfirewalladdname=hotspotcomment="accountauthorizedhotspotclients"

Passallthroughgoingtraffictohotspotchain:
/ipfirewallruleforwardaddaction=jumpjump-target=hotspot
comment="accounttrafficforauthorizedhotspotclients"

客户机输入任何网址,都自动跳转到登陆页面,输入账号密码,继续浏览。
如果使用ftp、pop3等,也必须先通过网页登录,才可以使用,当然使用winbox的时候也必须先登录。