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

Linux服务器
网管经验:打造网吧Linux代理服务器
Linux下如何使用光驱及读取非linux分区等
Linux主要shell命令详解
Linux下宽带设置使局域网连接互联网实例
网管入门之Linux服务器启动过程详解----通过/etc/inittab文件进行初始化
网管入门之Linux服务器启动过程详解----执行init进程
网管入门之Linux服务器启动过程详解----加载内核
网管入门之Linux服务器启动过程详解----启动GRUB/LILO
网管入门之Linux服务器启动过程详解----从BIOS到内核
如何恢复误删除的Linux文件
在Linux系统下建立强大的FTP搜索引擎
Linux操作系统的Configure参数解释说明
Linux系统下查CPU个数的方法
Linux攻略 DNS服务器安装配置方法详细介绍
Linux操作系统平台Vi指令大全
浅析linux操作系统登录帐户的管理和审计
在Linux上架设支持JSP+PHP的Web服务器
linux操作系统中bsd套接口开发的基础介绍
享受便利的应用方式—linux系统三则超酷技巧
LINUX VMWare-TOOLS的安装

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 77 ::
收藏到网摘: 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的时候也必须先登录。