跳至主要内容

内网域名访问内网服务器

部门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 产品随想的博客

A Sister’s Eulogy for Steve Jobs

I grew up as an only child, with a single mother. Because we were poor and because I knew my father had emigrated from Syria, I imagined he looked like Omar Sharif. I hoped he would be rich and kind and would come into our lives (and our not yet furnished apartment) and help us. Later, after I’d met my father, I tried to believe he’d changed his number and left no forwarding address because he was an idealistic revolutionary, plotting a new world for the Arab people. Even as a feminist, my whole life I’d been waiting for a man to love, who could love me. For decades, I’d thought that man would be my father. When I was 25, I met that man and he was my brother. By then, I lived in New York, where I was trying to write my first novel. I had a job at a small magazine in an office the size of a closet, with three other aspiring writers. When one day a lawyer called me — me, the middle-class girl from California who hassled the boss to buy us health insurance — and said his cl...

产品随想 | 周刊 第130期:集结信徒,而非官僚

On Dyson, techno-centric design and social consumption   https://2earth.github.io/website/20250707.html 如何創造偉大的事物   https://ryolu.notion.site/1610a94b9c108079a95be4362afd4a26 集結信徒,而非官僚 Reflections on OpenAI   https://calv.info/openai-reflections 创业架构 Shui   https://github.com/rock-zhang/Shui 好好喝水 https://www.ghibli.jp/works/ 吉卜力作品的高清图 From Skeuomorphic to Liquid Glass: Apple's Strategic Bet on the Post-Touch Future   https://omc345.substack.com/p/from-skeuomorphic-to-liquid-glass 迄今为止关于苹果Liquid Glass变革的解读,最好的一篇 The Nueva School   https://en.wikipedia.org/wiki/The_Nueva_School?useskin=vector 看起来是很酷的一个学校 The Barbican   https://arslan.io/2025/05/12/barbican-estate/ 史蒂夫·乔布斯希望你阅读的 9 本书   https://www.douban.com/doulist/147158849/ 《禅者的初心》里有句话:“做任何事,其实都是在展示内心的天性,这是我们存在的唯一理由。” Chuck Feeney was one of the greatest philanthropists ever   https://www.gatesnotes.com/Remembering-Chuck-Feeney 慈善家 My new deadline: 20 years to give away virtually all my wealt...

《Becoming Steve Jobs》Chapter 16 Blind Spots, Grudges, and Sharp Elbows

Steve could be pretty thin-skinned when someone prominent criticized the aesthetics of his products. He took great umbrage that Neil would, as Steve put it, “pop off in public like that without coming to talk to us about his technical concerns first.” From that point on he had rebuffed all of Neil’s attempts to smoke the peace pipe. 有趣 He had blind spots, grating behavioral habits, and a tendency to give in to emotional impulse that persisted his entire life. These characteristics are often used to make the case that Steve was an “asshole” or a “jerk,” or perhaps simply “binary”—that odd adjective often used to convey the sense that he was half asshole/half genius from birth to death. These aren’t useful, interesting, or enlightening descriptions. What’s more illuminating is to take a look at the specific ways in which Steve failed to do an effective job of tempering some of his weaknesses and antisocial traits, and to consider how, when, and why some of them continued to flare up even...

Steve Jobs at 44, By Michael Krantz, 1999

Differences and Similarities Between Apple and Pixar Apple turns out many products--a dozen a year; if you count all the minor ones, probably a hundred. Pixar is striving to turn out one a year. But the converse of that is that Pixar's products will still be used fifty years from now, whereas I don't think you'll be using any product Apple brings to market this year fifty years from now. Pixar is making art for the ages. Kids will be watching Toy Story in the future. And Apple is much more of a constant race to continually improve things and stay ahead of the competition.  His Role At Pixar At Pixar my job is to help build the studio and recruit people and help create a situation where they can do the best work of their lives. And to some degree it's the same at Apple. But at Pixar, I don't direct the movies, whereas at Apple probably, if I had to pick a role out of a film production, I'd be the director. So it...

2018各行业应届生薪资不完全样本往期汇总-职场红领巾

文章来源自职场红领巾公众号2018.4.21日推送,在此表示感谢 产品岗 百度商业产品 14K*14 拼多多产品管培 12K*14 今日头条产品 16K*18 头条PM整个Package接近300K/年 美团产品Offer 14K*16 base上海 百度产品研究生 11.5K*14.6 base 上海 京东产品17K*13 百度产品 220K/年 网易 产品培训生 硕士 15K*18 SP base杭州 不知名互联网公司校招PM 12K*15 base北京 技术岗 微软 软件工程师 本科 260K/年 蚂蚁金服算法工程师 20K*16 拼多多开发本科400K/年 商汤科技本科技术岗 14K/月 税前 海康威视研究院 算法工程师 220K/年 微信算法岗 SP 360K/年 的package 今日头条 程序员 研究生 10K/月 base北京 滴滴程序员 16K*16 亚马逊 小四年经验 研发 50K/月 Facebook应届毕业生  软件开发工程师   打包 115k$/年(30%-40%税) base湾区 京东算法 普通Offer 234K/年 运营岗 滴滴北京运营岗 硕士 12K*15 奖金另算 网易游戏运营 150K/年 左右 网易运营 8K*13(奖金0~3个月) 网易新闻运营8K/月 腾讯游戏运营 本科6K/月 上海京东时尚本科8K/月 京东运营岗 11K/月 base北京亦庄总部 今日头条 渠道营销运营 6K/月(加房补) 网易考拉 活动运营 13K*16 OFO城市运营管培13K*14 爱范儿运营 8K/月 滴滴长三角某二线城市运营管培生 薪资 7.6K*13 +每个月40%绩效 货车帮 数据运营 12K/月 卡宾电商 管培 10K/月 含浮动绩效 曹操专车 运营管培生  加各种补贴税前5.4K/月  base杭州 京东金融海龟回来8K/月 北京蓝港互动...

Foobar2000 组件安装教程

 原作者 博客地址   汉化作者 Asion博客   关于foobar 2000的一些资源 前言 foobar2000 由于其软件架构特点以及开放的姿态,使得第三方很容易开发组件(component)来拓展它的功能。由于在官网下载的默认安装文件只带了少量几个默认的组件,满足不了使用的需求,例如:默认不带 ape,tta,tak 等音频文件格式的解码器,很多无损压缩格式音乐没法播放。所以自己下载安装组件是必备的基本技能。 foobar2000 的中文汉化版(Asion 汉化)为了方便使用,集成了无损压缩文件解码器以及一些其它有用的插件,安装时选上即可,不喜欢折腾的建议使用汉化版。 这里组件指的是 foobar2000 标准组件(*.dll 文件),而非 vst 插件等其它插件,姑且把组件分为两类: 官方组件: 英文版安装包自带,安装时可选择; 第三方组件:非官方自带的组件 除了 foo_input_std.dll 和 foo_ui_std.dll 这两个组件是必须的外,其它的所有组件都 非必需 的,可以随需要增删。第三方组件可以去 官网 、 官方论坛 或者 官方 wiki 去找,也可以去贴吧等地逛逛。 下载 还是要强调一下,这里说的是 foobar2000 component ,不是中文网上通常说的 vst 插件。 下载好的组件包一般是 xxx.zip 或 xxx.fb2k-component 格式的文件,也有用 7z 打包的。前两种都是 zip 压缩(只要把 fb2k-component 改成 zip 文件就变成了 zip: 包)。标准状况下压缩包里的内容结构应该是 xxx.zip yyy.dll README.txt (可能没有) LICENCE.txt (可能没有) (其它杂七杂八) 除少数外一般只有一个 xxx.dll 文件.一定要注意压缩包结构不能是: xxx.zip yy folder (文件夹) zzz.dll … 否则要解压缩,提取那个 dll 文件。 安装 方法一(推荐) 打开 foobar2000 的菜单 文件 > 首选项(file >preferences) 的 组件(components...

Interview with Steve Jobs, WGBH, 1990

Interviewer: what is it about this machine? Why is this machine so interesting? Why has it been so influential? Jobs: Ah ahm, I'll give you my point of view on it. I remember reading a magazine article a long time ago ah when I was ah twelve years ago maybe, in I think it was Scientific American . I'm not sure. And the article ahm proposed to measure the efficiency of locomotion for ah lots of species on planet earth to see which species was the most efficient at getting from point A to point B. Ah and they measured the kilocalories that each one expended. So ah they ranked them all and I remember that ahm...ah the Condor, Condor was the most efficient at [CLEARS THROAT] getting from point A to point B. And humankind, the crown of creation came in with a rather unimpressive showing about a third of the way down...

黑客技术论坛推荐

原文来自知乎, 世界各大黑客技术论坛TOP排行榜 ,表示感谢 这份名单基本上囊括了目前世界上各大最佳黑客技术论坛。

产品随想 | 周刊 第106期:Architecture cannot save the world, but it may serve as a good example

“He who lives to see two or three generations is like a man who sits some time in the conjurer’s booth at a fair and witnesses the performance twice or thrice in succession. The tricks were meant to be seen only once; and when they are no longer a novelty and cease to deceive, their effect is gone.” — Arthur Schopenhauer 近 30 年戴镜史,分享我的配镜方法和粗浅经验   https://sspai.com/post/79573 Leslie Berlin   https://leslieberlinauthor.com/ 硅谷历史学家,对硅谷发展做出表述 曾撰写诺伊斯的传记,也是乔布斯Make Something Wonderful的编辑之一 Pre to postmortem: the inside story of the death of Palm and webOS   https://www.theverge.com/2012/6/5/3062611/palm-webos-hp-inside-story-pre-postmortem Palm的荣光 Loren Pope, former education editor for The New York Times, writes about Reed in Colleges That Change Lives, saying, "If you're a genuine intellectual, love the life of the mind, and want to learn for the sake of learning, the place most likely to empower you is not Harvard, Yale, Princeton, Chicago, or Stanford. It is the most intelle...

产品随想 | 周刊 第40期:献出心脏,直到高墙倒塌

标题来自本期的一个链接,觉得充满理想主义,献给大家! Products Movie Robot   https://github.com/pofey/movie_robot 定时自动从豆瓣电影的想看、在看、看过中获取影音信息,然后去PT站(支持多家站点)自动检索种子,找到最佳资源后按豆瓣电影分类提交到BT下载工具下载。在下载前,会自动检查你的Emby中是否已经存在。 工具超赞,一次搭建,可以很长一段时间躺平,但针对我这样对4K、HDR有高要求用户,可能不大行 Plash   https://github.com/sindresorhus/Plash Make any website your Mac desktop wallpaper 将任意网站,定义为Mac桌面 https://github.com/sindresorhus/Plash/issues/1,网友给的一些网站,也比较有意思 HomeBank   http://homebank.free.fr/zh/index.php 自由、开源的会计软件 GnuCash   https://www.gnucash.org/ https://github.com/Gnucash/gnucash 自由开源,多平台的财务软件,且有很好看的官方App,since 1998 beancount   https://github.com/beancount/beancount Beancount: Double-Entry Accounting from Text Files. 纯文本的复式记账工具 rimerc: rimer's dictionary & config   https://github.com/Bambooin/rimerc Rime输入法在各个平台的配置 Natural Selection Labs   https://github.com/NaturalSelectionLabs DIYGod主导的聚焦Web3的项目,非常有雄心,保持关注! PineTab   https://www.pine64.org/pinetab/ The Open Source ARM 64-bit Tablet 自由开源的64位平板电脑(在28...