跳至主要内容

内网域名访问内网服务器

部门ftp服务器和远程服务器内网域名无法访问问题困扰我好久,钻研了几天,终于明白了一些,和大家做一个分享,原帖子在这里,表示感谢

一. 网络需求

现状:内网中两台服务器,对外提供ftp和samba服务,网关路由器公网接口上已下发nat server 配置,DNS服务器位于公网,将两台服务器对应的域名映射到公网出口地址上,公网用户已经可以正常通过域名访问服务器
改进:内网用户可以使用域名或是公网IP访问内部服务器
涉及路由器:TL-WVR1300G  AC1300双频无线企业VPN路由器

二. 待选方案

方案一:DNS-mapping 方案:
    在路由器上配置DNS map功能,建立域名-公网地址-公网端口号-服务协议的匹配表项。当内网用户发出的DNS解析请求得到的DNS Server响应到达配置了NAT server 的公网出接口时,接口上查找到DNS map表项后会将内网服务器的地址替换解析到的公网地址,主机就可以使用内网地址直接访问服务器。

方案二:利用NAT 和NAT Server 下发在内网网关接口上,使内网主机通过公网地址去访问服务器。
   在不使用DNS-mapping的情况下,主机用域名访问服务器意味着主机必须能使用公网地址去访问内网服务器。通过将NAT和NATServer 配置下发在内网网关接口上可以满足该应用(原先下发在公网接口上的nat server 配置是为了满足公网用户访问的,该部分配置不变)。

三. 配置步骤

方案一配置 
<H3C>system-view
[H3C]sysname Gateway
[Gateway]interface g0/1
[Gateway-GigabitEthernet0/1]ip address 202.38.1.1 24
[Gateway-GigabitEthernet0/1]nat server protocol tcp global 202.38.1.1 www inside 10.110.1.1 www
[Gateway-GigabitEthernet0/1]nat server protocol tcp global 202.38.1.1 ftp inside 10.110.1.2 ftp
[Gateway-GigabitEthernet0/1]quit
[Gateway]interface g0/0
[Gateway-GigabitEthernet0/0]ip address 10.110.1.10 24
[Gateway-GigabitEthernet0/0]quit
// 注意dns-map 配置中对应的地址是公网地址而不是服务器的内网地址
[Gateway] nat dns-map domain www.server.com protocol tcp ip 202.38.1.2 port www
[Gateway] nat dns-map domain ftp.server.com protocol tcp ip 202.38.1.2 port ftp


方案二配置
<H3C>system-view
[H3C]sysname Gateway
[Gateway]acl number 3000
//编写acl 匹配来自内网网段目的地址为两台server的数据流
[Gateway-acl-adv-3000]rule permit ip source 10.110.1.0 0.0.0.255 destination 10.110.1.1 0
[Gateway-acl-adv-3000] rule permit ip source 10.110.1.0 0.0.0.255 destination 10.110.1.2 0
[Gateway]interface g0/0
[Gateway-GigabitEthernet0/0]ip address 10.110.1.10 24
//将nat及nat server 配置下发在内网网关口上
[Gateway-GigabitEthernet0/0]nat server protocol tcp global 202.38.1.1 www inside 10.110.1.1 
www.luyouqiwang.com
[Gateway-GigabitEthernet0/0]nat server protocol tcp global 202.38.1.1 ftp inside 10.110.1.2 ftp
[Gateway-GigabitEthernet0/0]nat outbound 3000
[Gateway-GigabitEthernet0/0]quit      
//其它基础配置略

四. 配置关键点

1.注意dns-map的配置中的ip地址应该配置公网出接口地址。
Nat server 的相关配置应该下发在公网出接口上。
2.在方案二中,nat server 及 nat outbound的配置应当配置在内网网关接口上。并且注意acl 规则中的目的地址应匹配服务器主机地址。
3. 在方案二中,可以使用 nat static 方式为私网server地址和公网地址间建立1对1转换。 这一配置可以用来代替nat server 的相关配置。

Popular posts from 产品随想的博客

产品随想 | 陪读《乔布斯传》:1-17章

乔布斯经典照片集 坐在麗莎電腦旁。他說:「毕加索曾說:「好的藝術家懂得模仿,佛大的藝術家善於偷取。」因此,窃取偉大的點子沒有什麼好羞耻的。 與蓋茲在電話中達成協議:「比爾,謝謝你支持蘋果。因為你的支持,世界將變得更美好。」 1997年蘋果在波士頓舉行的麥金塔世界大會,蓋茲透過衛星連線在巨大的螢幕上出現。質伯斯說:「我真是笨死了,竟然讓蓋兹以這種方式現身。他讓我看起來好沙小。」 ──时刻自省 前言 The people who are crazy enough to think they can change the world are the ones who do. 只有那些瘋狂到以為自己可以改變世界的人, 才能改變這個世界。 這麼些年來,賈伯斯說起話來的認真與專注態度,著實打動不少人。我們一直保持連絡,即使在他被逐出蘋果之後,我們還有來往。每次他有新產品要推出時,像 NeXT 電腦或皮克斯 (Pixar)的電影,他就會來找我。他常帶我去曼哈頓下城一家壽司店用餐,講起他的產品,渾身散發出光和熱,眉飛色舞的說這是他登峰造極之作。我喜歡這個人。 ──对自己产品深深的爱 他的堅持教我疑惑。人人都知道賈伯斯不道餘力捍衛隱私, 而且我不知道他是否看過我寫的任何一本傳記。我還是不敢立刻答應,只說或許再等等。然而到了 2009年,我接到他太太蘿琳. 鮑威爾打來的電話。她直截了當說:「如果你還想為史帝夫寫傳,最好趕快動筆。」這是他第二次因病向公司請長假。我坦言他早在2004 年得知自己罹患胰臟癌的時候就曾主動邀我寫傳,但我當時對他罹癌的事一無所知。蘿琳解釋說,他們盡量保密,因此當時根本沒幾個人知道。他是在動手術的前夕打電話給我的。 ──和Make Something Wonderful对照起来看 他還說,自從他回到蘋果重新掌權,這十二年來是他創造新產品的高峰期,但他還有更重要的目標,也就是效法惠普的惠立和普克(David Packard),締造一家創新動力無限的公司,進而超越惠普。 ──苹果公司才是乔布斯最得意的产品 他說:「我一直認為,自己是個偏向人文的孩子,但我也喜歡電子的東西。後來,我讀到寶麗來(Polaroid)創辦人蘭德 (Edwin Land)曾說過,一個人能站在人文和科學的交會口,兼容贯通,才是真正的人才。在那當下,我决定要當這樣的人。」他似乎在暗示我,這可以做為傳...

零碎思考 | 關於LLM的閱讀筆記

  通向AGI之路:大型语言模型(LLM)技术精要   https://zhuanlan.zhihu.com/p/597586623 拆解追溯 GPT-3.5 各项能力的起源   https://yaofu.notion.site/GPT-3-5-360081d91ec245f29029d37b54573756 清晰明瞭 A Closer Look at Large Language Models Emergent Abilities   https://yaofu.notion.site/A-Closer-Look-at-Large-Language-Models-Emergent-Abilities-493876b55df5479d80686f68a1abd72f 試圖說明LLM的涌現能力] 如何利用GPT-4打造高效智能信息收集神器   https://lpcv.org/fwc/a/MzU0MDk3NTUxMA==/2247483868/1 學習思路 GPT-4编码教程,如何用AI构建和宣传我的Midjourney网站增强插件   https://op7418.zhubai.love/posts/2254193381183922176 AUTOMATIC1111 GUI: A Beginner’s Guide   https://stable-diffusion-art.com/automatic1111/ 其實就是AI界的雲渲染,挺有意思的 Midjourney还是Stable Diffusion: 你应该选哪个?   https://zhuanlan.zhihu.com/p/617157677 看到作者下方的“註冊會計師”,中國太卷了 树莓派4B刷OpenWrt做路由器的经验+踩坑   https://zhuanlan.zhihu.com/p/451788328 關注其中的坑點 doc.openwrt.cc   https://doc.openwrt.cc/

《Becoming Steve Jobs》Chapter 13 Stanford

Steve was a natural performer who elevated business presentations to something close to high art. But what made him fidgety this day was the prospect of addressing the Stanford University graduating class of 2005. University president John Hennessy had broached the idea several months earlier, and after taking just a little time to think it over, Steve had said yes. He was offered speaking engagements constantly, and he always said no. In fact, he was asked to do so many commencement addresses that it became a running joke with Laurene and other friends who had college or graduate degrees: Steve said he’d accept one just to make an end run around them and get his PhD in a day, versus the years and years it had taken them. But in the end, saying no was simply a question of return on investment—conferences and public speaking seemed to offer a meager payoff compared to other things, like a dazzling MacWorld presentation, working on a great product, or being around his family. “If you loo...

产品随想 | 周刊 第115期:2024.5.16 Great libraries build communities

Loop   https://github.com/MrKai77/Loop Loop is a macOS app that simplifies window management for you! 我的电视 my-tv   https://github.com/lizongying/my-tv 我的电视 电视直播软件,安装即可使用 When we think about this technology, we need to put human dignity, human well-being—human jobs—in the center of consideration. ————Fei-Fei Li Author Talks: Dr. Fei-Fei Li sees ‘worlds’ of possibilities in a multidisciplinary approach to AI   https://www.mckinsey.com/featured-insights/mckinsey-on-books/author-talks-dr-fei-fei-li-sees-worlds-of-possibilities-in-a-multidisciplinary-approach-to-ai Randy Ubillos   https://apple.fandom.com/wiki/Randy_Ubillos Randall Hayes "Randy" Ubillos is the original software engineer behind Adobe Premiere and Final Cut Pro. 影响全球视频制作的男人, Reminders MenuBar   https://github.com/DamascenoRafael/reminders-menubar Simple macOS menu bar application to view and interact with reminders. Developed with SwiftUI and using Apple Reminders as a source. Bad libraries build colle...

ISSUU使用指南--木喵

作者: 木喵   出处: Wonderworks 问:issuu是什么? 答:Issuu是国外的一个在线文档共享网站,它是你的PDF文档发布专家。它类似于我们熟悉的youtube,但它共享的是文档、杂志之类的文本。 简而言之、同志们想看国外的各种杂志? 想找国外的汇报文本么? 想借鉴国外学生的作品集么? 那么你就要用到它啦~ 今天主要和大家讲两个方面 一、如何在pc端使用和下载issuu上的pdf文档 首先我们打开issuu的网址 https://issuu.com/ 我们可以很清楚的看到网页上呢都是国外的杂志以及一些作者自己制作的pdf文档 首先我们点击右上角的 sign up  然后填写相关信息注册一个账户: 注册完成之后我们就可以搜索我们想要找的资料: 比如说,我想找一些分析图的资料,我们就搜索: architecture diagram 然后我们就可以看到相关的文档了: 点击你所选择的文档, 好了问题来了: sorry,this publication is not available 这个时候!就需要在用pc端的我们做一件必不可少的事: 翻墙 然后我们就能将页面刷新粗来了 好、接下来是非常有建设性意义的一步 怎样把我们网页上的文件 下载下来 呢? 截图? no~no~no~ 接下来,让木喵告诉你怎么下载: 首先你需要复制上面的网址 然后将 https://wenfan.hk/issuu/index_link.php 在另一个网址中打开 将你之前复制的pdf的网址粘贴在下面的对话框中 点击 I‘m not a robot 再点击 get it 然后会出现一堆网址代码 我们 全选 打开你的迅雷点击 新建 将你之前的复制粘贴到下载链接里 然后呢~我们就全都下载成功啦~ 然后我们回到之前的网页向下看 我们可以看到有上传文档的作者(记得要关注哟) 然后还有 info   share   stack   ❤ 如果...

产品随想 | 周刊 第86期:Next Generation of AI

  gerev   https://github.com/GerevAI/gerev AI-powered enterprise search engine 聚合了Confluence,Slack,Jira等非常多的平台,还是很不错的 假如有个定位在C端的产品,能让用户自己来定义来源,就更好了,maybe是alist的思路(精准搜索已经被everything承接了) Dalai   https://github.com/cocktailpeanut/dalai Run LLaMA and Alpaca on your computer. 对计算机硬件的要求,并不高 Chatbox   https://github.com/Bin-Huang/chatbox Your Ultimate Copilot on the Desktop. Chatbox is a desktop app for GPT-4 / GPT-3.5 (OpenAI API) that supports Windows, Mac & Linux. Tune-A-Video   https://github.com/showlab/Tune-A-Video Tune-A-Video: One-Shot Tuning of Image Diffusion Models for Text-to-Video Generation Given a video-text pair as input, our method, Tune-A-Video, fine-tunes a pre-trained text-to-image diffusion model for text-to-video generation. Diffusion的本质是模仿和乐高式的重新拼接 Jensen Huang — NVIDIA's CEO on the Next Generation of AI and MLOps   https://wandb.ai/wandb_fc/gradient-dissent/reports/Jensen-Huang-NVIDIA-s-CEO-on-the-Next-Generation-of-AI-and-MLOps--Vmlldz...

認知香港-梁啟智推薦書目

///// 推 薦 書 單 在 這 邊 ///// 1.《香港簡史》,高馬可,2021,蜂鳥。 2.《香港人之香港史 1841-1945》,蔡榮芳,2000,牛津大學出版社。 3.《穿梭太平洋︰金山夢、華人出洋與香港的形成》,冼玉儀,2019,中華書局。 4.《被遺忘的六日戰爭:1899年新界鄉民與英軍之戰》,夏思義 ,2014,中華書局。 5.《香港六七暴動始末》,程翔,2018,牛津大學。 6.《地下陣線:中共在香港的歷史》,陸恭蕙,2011,香港大學出版社。 7.《香港80年代民主運動口述歷史》,馬嶽 ,2012,香港城市大學。 8.《我是記者:六四印記:六四30》,2019,香港記者協會-人民不會忘記基金。 9.《胸懷祖國 : 香港「愛國左派」運動,趙永佳,呂大樂,容世誠,2014,牛津大學出版社。 10.《勾結共謀的殖民權力》,羅永生,2015 ,牛津大學出版社。 11.《殖民無間道》,羅永生,2017,牛津大學出版社。 12.《中國香港 : 文化與政治的視野》,強世功,2008,牛津大學出版社。 13.《中國天朝主義與香港》,陳冠中,2012,牛津大學出版社。 14.《變局下的徘徊 : 從戰後到後九七香港教會社關史論 》,邢福增,2018,印象文字。 15.《回歸人心——極權臨近的香港文化經濟學》,許寶強,2018,牛津大學出版社。 16.《香港, 鬱躁的家邦 : 本土觀點的香港源流史》,徐承恩,2019,左岸文化。 17.《彭定康英文自傳》,彭定康。 18.《許家屯香港回憶錄(上.下)》,許家屯,1993,聯經出版公司。 19.《大江東去——司徒華回憶錄》,司徒華,2011,牛津大學出版社。 20.《拱心石下——從政十八年》,吳靄儀,2018,牛津/啟思。 21.《相遇》,周保松,2008,牛津大學出版社。 22.《受苦與反抗:陳健民.獄中書簡》,陳健民,2022,聯經出版公司。 23.《破解香港風威權法治:傘後與反送中以來的民主運動》,黎恩灝,2021,新銳文創。 24.《特區選舉:制度與投票行為》,蔡子強,馬嶽,陳雋文,2021,香港城市大學。 25.《二十道陰影下的自由:香港新聞審查日常》,區家麟,2017,中文大學出版社。 26.《香港第一課》,梁啟智,2019,春山。 27.《管治香港:英國解密檔案的啟示》,李彭廣,...

产品随想 | 周刊 第59期:中华人民共和国史

Products anti-anti-AD   https://github.com/Mosney/anti-anti-AD 为什么不应使用antiAD去广告列表,以及选择更多优秀的替代品 很多此类域 Diffusion Bee   https://github.com/divamgupta/diffusionbee-stable-diffusion-ui Diffusion Bee is the easiest way to run Stable Diffusion locally on your M1 Mac. 门槛好高... M1 Aloud   https://aloud.area120.google.com/ Aloud is part of Area 120, Google’s in-house incubator for new products and services. 除去现在的自动生成CC字幕外,探索直接将视频的音轨,变换为其它语言,Google牛逼! Citizenship Consciousness & Privacy 董乐山   https://zh.wikipedia.org/zh-sg/董乐山 简介很短,但足以看到时代对他的残酷 《第三帝国的兴亡》 中华人民共和国史   https://cup.cuhk.edu.hk/chinesepress/promotion/prc_sample/index.htm 第一卷 断裂与延续──中华人民共和国的创建(1949-1952)(即将出版) 杨奎松 (估计审查,也没机会了) 第二卷 向社会主义过渡 ── 中国经济与社会的转型(1953-1955) 林蕴晖 第三卷 思考与选择 ── 从知识分子会议到反右派运动(1956-1957) 沈志华 第四卷 乌托邦运动──从大跃进到大饥荒(1958-1961) 林蕴晖 第五卷 历史的变局──从挽救危机到反修防修(1962-1965) 钱庠理 第六卷 「砸烂旧世界」──文化大革命的动乱与浩劫(1966-1968) 卜伟华 第七卷 新秩序和新冲突──从中共九大到林彪事件(1969-1971) (即将出版) 高华(作者去世,应该没有机会了) 第八卷 难以继续的「继续革命」 ──从批林到批邓(1972-1976...

MarkdownPad 2 Pro

有点讨厌Office套件的臃肿,有时候仅仅是记录一个小想法,尽管自己机器很强劲,但打开的延迟还是会让自己觉得很不舒服,于是乎,投到Markdown坑里,正在尝试三款Markdown编辑器

产品随想 | 周刊 第114期:AT THE INTERSECTION OF ART AND TECHNOLOGY

Adeus   https://github.com/adamcohenhillel/ADeus An open source AI wearable device that captures what you say and hear in the real world and then transcribes and stores it on your own server. You can then chat with Adeus using the app, and it will have all the right context about what you want to talk about - a truly personalized, personal AI. 开源的个人语音AI硬件 Upscayl   https://github.com/upscayl/upscayl Upscayl - #1 Free and Open Source AI Image Upscaler for Linux, MacOS and Windows. Kotatsu   https://github.com/KotatsuApp/Kotatsu Manga reader for Android AntiAntiDefraud   https://github.com/MinaMichita/AntiAntiDefraud Stop uploading my installed app list! Miui! Hide My Applist   https://github.com/Dr-TSNG/Hide-My-Applist An Xposed module to intercept applist detections We don’t read and write poetry because it’s cute. We read and write poetry because we are members of the human race. And the human race is filled with passion. And medicine, law, business, engineerin...