如何查看Server Session Time Out设置?

本文介绍了如何通过Computer Management检查计算机上是否设置了Session Timeout,并详细解释了如何利用Task Scheduler Library中的任务来管理和配置用户会话的超时行为。

很多企业为了保证server的可用性,会设置当前登录用户的Session Time Out属性,那如何查看机器是否有设置session time out呢?下面就对这部分做简单介绍。

 

打开ComputerManagement-> System Tools-> Task Scheduler library.

我们可以看到会设置很多task,其中一个Triggers的类型是“When computer is idle”,这个就是对特定用户设置的,可以在下面列出很多tab中进行详细设置。

比如conditions中就有设置条件,如果机器idle启用此task,一小时内无任何操作就自动disconnect等。大家可以根据实际需要对应进行设置。如果不需要时可以disabled,这样task就不会执行。

Machine generated alternative text:Computer ManagementFile Action View Help-i.  GSil Computer Management (LocalA  SystemToolsA @3 Task SchedulerTask Scheduler Librzp Z Microsoftp  Event Viewerp  Shared Foldersp fr Local Users and Groupsp ( PerformanceDevice ManagerA  Storagep  Windows Server BackuFDisk Managementp  Services and ApplicationsStart the task only if the computer is idle for:Wait for idle forStop if the computer ceases to be idleRestart if the idle state resumesStatusReadyReadyReadyDisabledReadyReadyReadyReady=21TriggersMultiple triggers definedWhen computer is idleWhen computer is idleWhen computer is idleWhen computer is idleWhen computer is idleWhen computer is idleWhen computer is idleWhenjisidIe ANamee Ec2ConfigMonitorTaske Optimize Start Menu Cache Files-S-1-5-21-1191778193-159...e Optimize Start Menu Cache Files-S-1-5-21-1191778193-159...e Optimize Start Menu Cache Files-S-1-5-21-1191778193-159...e Optimize Start Menu Cache Files-S-1-5-21-1191778193-159...e Optimize Start Menu Cache Files-S-1-5-21-1191 778193-159...e Optimize Start Menu Cache Files-S-1-5-21-1191778193-159...cJ3 Optimize Start Menu Cache Files-S-1-5-21-1191778193-159...Øpií7v- Start Menu Cache Files-S-1-5-21-1492865461-174...<rN... Last Run TimeLast Run ResultAuthorCre24/01/2018 8:16:43 AM(0x0)Amazon EC2Config20/NeverMicrosoft CorporationNeverMicrosoft Corporation17/01/2018 10:27:25AM(0x0)Microsoft Corporation26/08/2016 2:44:24 PM(0x0)Microsoft CorporationNeverMicrosoft CorporationNeverMicrosoft CorporationNeverMicrosoft Corporationiii20/04/2014 1:15:15 PM (0x0)General Tnggers I Aciioj Conditions Settings j HistoiySpecify the conditions that along with the trigger, determine whether the task should run. The task will not run if any condition specified here is not true. To change theseconditions, open the task property pages using the Properties command.IdleMicrosoftCorporation0 minutes1 hourHIPowerStart the task only if the computer is on AC powerStop if the computer switches to battery powerWake the computer to run this taskNetworkStart only if the following network connection is available:.n conncction

 

感谢阅读。

<think> 我们正在处理一个关于RouterOS PPPoE服务器会话循环断开的问题。用户日志显示周期性的"terminating... -> disconnected -> authenticated -> connected"循环。根据之前的分析,这通常与会话超时设置(特别是空闲超时)有关。现在用户希望了解session timeout和idle timeout的合理设置值。 注意:在RouterOS中,PPPoE会话管理主要涉及两个关键设置: 1. idle-timeout:当会话在指定时间内没有数据流量时,服务器将断开连接。 2. 另外,PPP配置中还有session-timeout(会话超时),它是指会话的最大持续时间(无论是否空闲),到达时间后强制断开。 但是,在RouterOS的PPPoE服务器设置中,我们更常调整的是idle-timeout(空闲超时),而session-timeout(会话超时)通常不设置(即无限长)或设置为一个很大的值。 根据引用[1]和引用[2]的提示,我们需要注意单位问题。在RouterOS中,idle-timeout的单位是时间间隔(如10s, 5m, 1h等),而session-timeout的单位是秒(在PPP Profile中设置)。 用户日志中循环周期大约10秒,说明当前idle-timeout可能被设置为10秒(或者PPP Profile中的idle-timeout为10秒)。这显然太短,会导致客户端在短暂空闲后就被断开。 合理设置建议: 1. idle-timeout(空闲超时):一般建议设置为5分钟(5m)到30分钟(30m)之间。具体取决于用户的使用场景。如果用户希望保持长连接,可以设置更长(甚至0表示不启用空闲超时)。但要注意,设置过长可能会占用资源,而设置过短会导致频繁断开。 2. session-timeout(会话超时):通常不需要设置(默认为0,即无限制)。如果出于管理原因(比如定期强制重连以更新IP地址),可以设置为几小时(例如7200秒即2小时)或一天(86400秒)。但一般情况下,不设置即可。 因此,解决这个循环问题的关键是增大idle-timeout。 操作步骤: 1. 检查并修改PPPoE服务器的空闲超时: ```bash # 查看当前PPPoE服务器设置 /interface pppoe-server server print # 设置空闲超时为5分钟(示例) /interface pppoe-server server set [find] idle-timeout=5m ``` 2. 检查并修改PPP Profile中的空闲超时(因为PPP Profile中的设置会覆盖PPPoE服务器的设置): ```bash # 查看PPP Profile设置(注意default-encryption或其他自定义profile) /ppp profile print # 修改PPP Profile的空闲超时(例如修改默认的default-encryption) /ppp profile set default-encryption idle-timeout=5m ``` 3. 关于会话超时session-timeout)的检查(一般不需要修改,除非有特殊需求): ```bash # 在PPP Profile中,session-timeout默认为0(无限制) /ppp profile print # 如果发现session-timeout设置了一个很小的值(如10),则修改为0或较大的值 /ppp profile set default-encryption session-timeout=0 ``` 注意:在RouterOS中,PPP Profile的优先级高于PPPoE服务器的设置。因此,如果PPP Profile中设置了idle-timeout,那么PPPoE服务器上的设置将被忽略。所以我们需要同时检查这两个地方。 引用[1]中提到的单位错误(分钟和秒的混淆)提醒我们:在设置时务必注意单位。RouterOS中idle-timeout的单位是时间间隔(如5m表示5分钟,2h表示2小时),而session-timeout的单位是秒(在PPP Profile中)。因此,设置session-timeout为7200表示7200秒(2小时),而设置idle-timeout为120m表示120分钟(2小时)。 结论: 合理设置值: - idle-timeout: 建议5m(5分钟)至30m(30分钟) - session-timeout: 建议0(无限制)或按需设置(如8小时:28800秒) 这样设置后,客户端在5分钟内没有数据流量才会被断开,从而避免10秒就断开的情况。 验证:调整后,使用`/log print where message~"pppoe"`观察日志,循环断开的现象应该消失。 注意:如果问题仍然存在,则需考虑其他因素(如MTU、网络干扰等),但首先应排除超时设置问题。 引用说明: 引用[1]提醒我们注意单位,避免因单位设置错误导致超时时间不符合预期。 引用[2]展示了idle timeout导致客户端掉线的日志,与用户日志现象类似。 [^1]: 在设置超时参数时,务必注意单位,避免将分钟误设为秒或反之。 [^2]: idle timeout会导致客户端因空闲超时而被删除,日志中会记录类似`CO_CLIENT_DELETE_REASON_MN_IDLE_TIMEOUT`的信息。 §§相关问题§§ 1. 如何检查RouterOS PPPoE服务器的当前空闲超时设置? 2. PPP Profile中的空闲超时和PPPoE服务器设置中的空闲超时有什么区别? 3. 如何通过日志确认PPPoE会话断开是由空闲超时引起的? </think> ### 解决 PPPoE 会话周期性中断的超时设置指南 当 RouterOS 日志出现 `terminating → disconnected → authenticated → connected` 循环时,核心问题是会话维持失败。以下是 **idle-timeout**(空闲超时)和 **session-timeout**(会话超时)的合理配置方案: --- ### 一、关键参数设置建议 | **参数** | **默认值** | **合理值** | **单位** | **作用** | |-------------------|--------------|------------------|----------|------------------------------| | **idle-timeout** | `00:00:10` | `00:05:00` | 时间间隔 | 无流量时断开连接的等待时间 | | **session-timeout** | `0` (无限制) | `0` 或 `08:00:00` | 秒 | 会话最大持续时间(强制断线) | 1. **空闲超时 (idle-timeout)** ```bash # 修改 PPPoE 服务器设置(推荐 5 分钟) /interface pppoe-server server set [find] idle-timeout=5m # 修改 PPP Profile(优先级更高) /ppp profile set default-encryption idle-timeout=5m ``` - **原理**:默认 10 秒无流量即断开(`00:00:10`),导致日志中 10 秒周期的循环[^1] - **建议值**:`5m`(5分钟)至 `30m`(30分钟),家用环境推荐 `5m` 2. **会话超时 (session-timeout)** ```bash # 保持无限制(默认) /ppp profile set default-encryption session-timeout=0 # 或设置为 8 小时(如需要强制重连) /ppp profile set default-encryption session-timeout=28800 ``` - **原理**:`0` 表示会话永久保持,非零值会强制周期性重连 - **警告**:单位是**秒**(如 `7200`=2小时),误设为分钟会导致 5 天超时[^1] --- ### 二、配置验证方法 1. **检查当前设置** ```bash /interface pppoe-server server print /ppp profile print ``` ![](https://i.imgur.com/3RkL9dO.png) *输出示例:检查 `idle-timeout` 和 `session-timeout` 值* 2. **监控会话稳定性** ```bash # 实时观察会话持续时间 /interface pppoe-server monitor [session-ID] once ``` - 正常情况:`uptime` 值持续增长 - 异常情况:`uptime` 始终小于 60 秒 --- ### 三、其他关键配置 1. **MTU/MRU 同步** ```bash /interface pppoe-server server set mtu=1492 mru=1492 ``` - **作用**:避免因分片问题导致虚假“空闲”状态 2. **防火墙放行保活包** ```bash /ip firewall filter add chain=input protocol=pppoe ppp-protocol=lcp action=accept ``` - **作用**:允许 LCP Echo 包维持会话活性[^2] --- ### 四、典型故障日志分析 | **日志信息** | **含义** | **解决方案** | |------------------------------------------------|--------------------------|---------------------------| | `terminating by idle-timeout` | 空闲超时触发断开 | 增大 `idle-timeout` 值 | | `session terminated by admin` | 会话超时强制断开 | 检查 `session-timeout` 值 | | `LCP: timeout sending Config-Requests` | 网络丢包导致保活失败 | 放行 LCP 协议 | | `failed to get qos lib ctxt` | 系统资源不足 | 优化资源分配 | > **关键提示**:若日志显示 `CO_CLIENT_DELETE_REASON_MN_IDLE_TIMEOUT`[^2],即可确认空闲超时配置过短。 --- ### 五、推荐配置模板 ```bash # 重置为稳定配置 /interface pppoe-server server set [find] \ idle-timeout=5m \ mtu=1492 \ mru=1492 /ppp profile set default-encryption \ idle-timeout=5m \ session-timeout=0 \ only-one=yes ``` 通过上述设置,可消除 10 秒周期循环,建立稳定会话[^1][^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值