地狱已满服务器搭建教程-2 网络配置篇 NMRIH Dedicate Server

简介:地狱已满(NMRIH)私人服务器 开放到互联网教程

服务器搭建篇:地狱已满服务器搭建教程-1 服务器安装篇
网络配置篇    :地狱已满服务器搭建教程-2 网络配置篇(本文)

本教程主要为个人自学所写,如有错误或值得改进的地方,欢迎留言指出,感激不尽

那么废话少说,直接进入正题

一、查看自己的网络环境

第一步: 确定自己的网络环境。如何判断自己的网络IP类型: https://www.bilibili.com/read/cv9854865

第二步: 获取用来搭建服务器的主机IP地址:按下 Win + R,输入 cmd 打开命令行,输入 ipconfig

ipconfig

在这里插入图片描述

第三步:

  • 如果 第一步 检查确定是 公网IP,跟 第二章
  • 如果 第一步 检查确定不是 公网IP,跟 第三章
  • 如果无法确定是不是 公网IP,可以直接跟 第三章

二、公网IP + 端口映射

前提:公网IP,且路由器有 端口映射DMZ 功能
           不同路由器后台界面不一定相同,请先在百度搜索:路由器型号 + 端口映射/内网穿透 确认你的路由器支持

  1. 查看路由器信息(一般在路由器底部)

    • 路由器管理后台 IP地址
    • 路由器管理后台 账户名密码

  2. 访问路由器管理后台

    在电脑浏览器输入路由器管理后台 IP地址,输入 账户名密码登录 登录后台系统

    在这里插入图片描述

  3. 登陆后,找到 端口映射 功能,创建协议为 UDP,端口号为 27015 的映射

    • 服务名 :随意
    • 局域网IP :服务器主机IP地址(第一章 第2步 中查看的 IP地址)
    • 服务协议 :UDP
    • 内/外部端口:27015

    在这里插入图片描述

    在这里插入图片描述

########################################################################################
# 网络配置 - 公网IP + 端口映射方案 到此结束
# 下一步可以启动服务器,验证是否可以被别人访问到
# 如果无法连接,参考 文末答疑 或考虑使用第三章的 内网穿透 方案
########################################################################################


三、非公网IP

方法① - 申请公网IP

  • 打电话给运营商客服 --> 申请公网IP
  • 顺利的话十几分钟即可搞定,获得 动态公网IP,然后回到 第二章 跟着做即可
  • 如果不顺利再考虑使用内网穿透

方法② - 内网穿透 (frp)

1. 内网穿透 - 简介

介绍: 说简单点就是找一台有公网IP地址的主机,让它帮忙监听 27015 端口的数据,只要监听到数据就转发给内网主机处理

已知优点:

  • 选择多:现在有很多内网穿透服务提供商,如:花生壳、ngrok、星空frp等
  • 适应性强:无论是公网还是局域网IP都能使用
  • 安全性高:对于外界而言,他们是直接与代理主机交流,并不知道内网主机的地址

已知缺点:

  • 不稳定:下文示范使用的 frp 虽然有免费服务,但是免费的节点经常被ddos,导致服务不可用
  • 带宽受限:一方面受限于代理主机转发的带宽,一方面受限于本地主机的带宽
  • 延迟略高:因为用户需要先与代理联系,代理再转发数据给服务器(建议选择离服务器最近的代理)
  • 奇奇怪怪:有时只映射 UDP-27015 端口立马就可以在互联网搜到,有时只能通过 控制台connect 命令连接

2. 内网穿透 - 教程

本教程使用 星空frp 示范,如果自己有更好的选择,也可以使用其他的服务商

选择 星空frp 理由

  • 支持自定义外部端口
  • 免费套餐提供了 8M 的带宽,相当于 1MB/s,理论能够满足以下情况稳定运行
    • 1 个 【3倍全跑模式】 服务器,满 9 人
    • 3 - 4 个 【经典模式】 服务器,满 8 人

开始操作

  1. 注册一个星空frp账号并登录 (星空frp官网)

  2. 创建一条隧道用于转发服务器端口,具体步骤看图(可能需要实名验证)

    • 补充:图中 ④ 可以不填留空(前提是你的 frp客户端游戏服务器同一台主机

      在这里插入图片描述

  3. 下载 星空frp 客户端

    先下载星空frp客户端并解压,解压后有 4 个文件(下方有详细说明)

    • frpc.exe

      内网穿透客户端执行程序,直接运行无效

    • frpc.ini

      内网穿透配置文件,新添加的隧道信息要填写在这里

    • 点此使用【配置文件】启动.bat

      隧道信息配置完成后,双击运行就能启动内网穿透服务

    • 点此使用【启动命令】启动.bat

      不需要配置文件,在隧道列表中获取启动命令,双击运行并粘贴启动命令就能启动内网穿透服务

  4. 启动内网穿透服务

    配置文件启动启动命令启动 两种方式效果一样,推荐第二种,比较方便

    ① 启动命令启动

    • 打开 隧道列表 确认隧道已经启动
    • 隧道列表 中获取 启动命令
    • 双击运行 点此使用【启动命令】启动.bat ,粘贴启动命令就能启动内网穿透服务
    • Tips:此方法每次启动内网穿透服务都需要粘贴启动命令

    在这里插入图片描述

    在这里插入图片描述

    ② 配置文件启动

    • 打开 隧道列表 确认隧道已经启动
    • 然后在 <>③配置文件 栏目,选择隧道所在的节点,复制配置文件内容
    • 编辑 frpc.ini 文件,粘贴配置文件内容(注:原有内容需清空,仅保留官网中复制来的配置文件)
    • 双击运行 点此使用【配置文件】启动.bat 即可启动内网穿透服务
    • Tips:此方法只需配置一次,以后直接双击运行 点此使用【配置文件】启动.bat 即可

    在这里插入图片描述

    在这里插入图片描述

########################################################################################

# 网络配置-内网穿透方案 到此结束
# 下一步可以启动服务器,验证是否可以被别人访问到
########################################################################################


疑难解答

  • 问题1:内网穿透创建隧道时提示 “端口已被占用”
    解答: 换一个端口即可,启动服务器时指定你设置的端口。比如换成27016,则启动命令如下

    srcds.exe ./srcds_run -game nmrih -port 27016 -maxplayers 8 +map nmo_suzhou
    
  • 问题2:云服务器设置了内网穿透,内网穿透也启动成功,但是无法连接服务器
    解答: 确保服务器安全组中对应的端口已经放行!

  • 问题3:是否需要开放 TCP 协议的 27015 端口
    参考: 官网建议-端口开放   |   维基:NMRIH 服务器安装 [英]
    解答: 开放 UDP 协议的 27015 端口即可。(参考文中建议 TCP-27015 端口仅在你需要使用远程控制台时在开启)

  • 问题4:路由器品牌和本文不同,找不到端口映射或不知道如何设置
    解答: 翻开路由器背面查看路由器型号,搜索 路由器型号 + 端口映射。(学会利用搜索引擎,能解决99%问题)

  • 问题5:一定要用端口映射吗?用 DMZ 是否可以
    解答: 可以,但是不建议,容易被他人攻击。(如:DDOS)

  • 问题6:好友收藏了我的服务器,过几天却从收藏里消失了,但在互联网能找到
    解答: 家用网络的公网IP一般是动态IP,每隔几天就会变动。(这就好比我收藏了你家的门牌号,但是过了几天你搬家了,收藏旧地址指向自然也随之变化了)

  • 问题7:家用电脑开服,有玩家成功加入服务器,但自己只能在局域网里可以看到自己的服务器
    个人理解: 无伤大雅。原因大概是你的游戏主机与服务器主机在同一的局域网内,使用的是C类局域网建立连接,所以只能在局域网中搜索到服务器。但对于互联网的其他人来说,他们不在你的路由器局域网里,只能与你的外网ip建立连接,所以能在互联网看到你的服务器。

  • 问题8:为什么服务器已经有其他玩家加入了,而我在 steam 邀请好友加入游戏,却怎么都进不来?

    解答: 如果在局域网内向好友发出游戏邀请,好友收到的可能是服务器的局域网IP地址。让好友试试在互联网搜索,或者在游戏控制台中输入 connect 公网IP地址:端口号

    例如:connect 123.23.34.56:27015

  • 问题9:(路由器端口映射设置完成) 或 (内网穿透配置完成,启动成功)。但是无法从互联网连接到服务器

    1. 判断 27015 端口 是否已开启

      Windows 系统可在 cmd 命令行中输入如下命令检测:

      netstat -ano -p udp | find “27015” >nul 2>nul && echo 27015端口已开启 || echo 27015未开启
      

      在这里插入图片描述

    2. 检查是否被系统防火墙拦截

      先关闭所有杀毒软件和防火墙,看看好友是否能连接到你的服务器。
      如果能,说明被杀毒软件或者防火墙拦截了(以win11为例,在防火墙中放行 27015 端口步骤如下)

      命令行输入control 打开控制面板 	--> 	Windows Defender 防火墙	 -->	高级设置	-->	入站规则 -->
      --> 新建规则 	--> 	端口 	--> 下一页 	-->		选择 UDP 规则 --> 	特定本地端口填写27015 --> 
      --> 下一页 		--> 允许连接 	--> 下一页 	--> 	规则全选 	 --> 	下一页 	--> 填写名称和描述
      
    3. 如果还是无法被好友发现,试试将官网推荐的端口号全部放行: 端口设置建议 [英]

    4. 如果走的是 第二章公网部署,考虑自己是内网而不是公网(并非自己设置的问题,要找运营商解决或使用内网穿透)

    5. 玄学!

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
### 回答1: My Approach to Difficulties in Learning Learning is not always easy, and we all face difficulties and challenges at some point in our educational journey. When faced with difficulties, it is important to have a strategy for overcoming them. Here are a few approaches that I have found to be effective in tackling learning challenges. One of the most important things to do when faced with a difficult concept is to break it down into smaller, more manageable pieces. This can be done by identifying the key takeaways from the material and focusing on understanding those key points. Another useful approach is to seek help from others. Whether it be talking to a classmate, teacher or tutor, getting a different perspective on a difficult topic can be very beneficial. They can also offer guidance and advice on how to approach the material and provide resources to help with understanding. Practice is also a key aspect of overcoming learning difficulties. By practicing a concept or skill, it will become more familiar and easier to understand. For example, working on practice problems or doing sample questions can help in math or science classes, while using flashcards or repetition can help with memorization. Finally, it's important to be patient with yourself and not give up too easily. Learning is a process and it may take time to fully understand a concept. It's also important to remember that making mistakes is a natural part of the learning process. In summary, my approach to difficulties in learning involves breaking down the material into manageable pieces, seeking help from others, practicing regularly, and being patient and persistent. ### 回答2: My Approach to Difficulties in Learning When faced with difficulties in learning, I adopt a series of strategies to overcome them. Firstly, I break down the problem or concept into smaller, manageable parts. By doing so, I am able to focus on each component individually, gaining a clearer understanding of the whole picture. Secondly, I actively seek help and guidance. Whether it is from my teachers, classmates, or online resources, I am not hesitant to reach out and ask for assistance. Collaborating with others not only enhances my knowledge, but also allows me to learn from their perspectives and experiences. Additionally, I maintain a positive mindset, reminding myself that mistakes are an integral part of the learning process. Rather than becoming discouraged by setbacks, I view them as opportunities for growth and improvement. By embracing challenges, I become more resilient and develop a sense of perseverance. Moreover, I create a structured study routine to effectively manage my time and resources. I prioritize tasks and allocate sufficient time for each subject, ensuring that I dedicate quality attention to all aspects of my learning. This not only helps me stay organized but also prevents procrastination. Lastly, I regularly review and revise the material learnt. Repetition is key to solidifying knowledge and retaining information. By regularly revisiting past lessons, I reinforce my understanding and reinforce the concepts, improving long-term retention. In conclusion, my approach to difficulties in learning involves breaking down problems, seeking help, maintaining a positive mindset, creating a structured study routine, and reviewing regularly. By employing these strategies, I am able to effectively navigate obstacles and enhance my learning experience. ### 回答3: 我的应对困难的方法 Learning is a journey filled with ups and downs. Throughout my academic journey, I have encountered various difficulties that have challenged me and pushed me to find effective ways to overcome them. Here are some of my approaches to dealing with difficulties in learning. Firstly, when faced with a difficult concept or subject, I believe it is essential to seek help. I usually start by reaching out to my teachers or professors for guidance. They have the expertise and knowledge to explain complex ideas in a simplified manner. Additionally, I also consult my classmates who might have a better understanding of the topic. Collaborating with others not only enhances my learning experience but also provides alternative perspectives that help broaden my understanding. Furthermore, time management plays a crucial role in overcoming learning obstacles. I have learned to prioritize tasks and allocate my study time effectively. By setting realistic goals and breaking down larger tasks into smaller manageable chunks, I can stay organized and avoid feeling overwhelmed. This approach allows me to focus on one task at a time, increasing productivity and comprehension. Another strategy I employ is utilizing various resources available to me. Technology has proven to be a valuable tool in my learning process. I take advantage of online platforms, educational apps, and websites that offer tutorials and explanations. These resources provide additional support and allow me to review and reinforce my understanding of challenging concepts at my own pace. Lastly, a positive mindset is crucial when facing difficulties in learning. Instead of viewing challenges as setbacks, I perceive them as opportunities for growth. I remind myself that mistakes and failures are part of the learning process. By embracing a growth mindset, I become more resilient and motivated to push through and find solutions to my difficulties. All in all, my approach to difficulties in learning involves seeking help, effective time management, utilizing various resources, and maintaining a positive mindset. By implementing these strategies, I have been able to overcome obstacles and continue progressing in my academic journey.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值