水果奶奶第二论坛阁下:routerOS高手进

来源:百度文库 编辑:高考问答 时间:2024/04/29 06:35:20
环境:

单机 一块集成网卡 windows XP 能上网,ip是:218.56.AAA.227 (A表示一个数值,这是出于安全考虑),就是Windows里的网卡1(此卡为真实网卡)

安装 VMware ,把VMware虚拟在Windows里的2个网卡卸掉。

Windows添加硬件,添加上 回环适配器 Microsoft Loopback Adapter,(即windows里的网卡2)修改 ip为192.168.10.2 网关192.168.10.1

察看windows的路由列表 如下
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.10.1 192.168.10.2 30
0.0.0.0 0.0.0.0 218.56.AAA.225 218.56.AAA.227 20(为了共享上网,把该行去掉了)
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.10.0 255.255.255.0 192.168.10.2 192.168.10.2 30
192.168.10.2 255.255.255.255 127.0.0.1 127.0.0.1 30
192.168.10.255 255.255.255.255 192.168.10.2 192.168.10.2 30
218.56.AAA.224 255.255.255.224 218.56.AAA.227 218.56.AAA.227 20
218.56.AAA.227 255.255.255.255 127.0.0.1 127.0.0.1 20
218.56.AAA.255 255.255.255.255 218.56.AAA.227 218.56.AAA.227 20
224.0.0.0 240.0.0.0 192.168.10.2 192.168.10.2 30
224.0.0.0 240.0.0.0 218.56.AAA.227 218.56.AAA.227 20
255.255.255.255 255.255.255.255 192.168.10.2 192.168.10.2 1
255.255.255.255 255.255.255.255 218.56.AAA.227 218.56.AAA.227 1
Default Gateway: 192.168.10.1 (看这一行)
===========================================================================
Persistent Routes:
None

在VMware里 新建一个系统,配置该系统的硬件,再添加上1块网卡(共2块),网卡1 和Windows里的网卡1桥接,网卡2和windows里的网卡2桥接。

在VMware里安装 RouterOS 2.96, 进入setup,设置网卡1的ip 为218.56.AAA.243 网关和掩码都跟windows里网卡1的一样

回到windows ,用浏览器 打开 218.56.AAA.243 下载 winbox

用winbox,来设置VMWare的网卡2 ,ip 192.168.10.1 网关和掩码都和windows里的网卡2一样

ip-〉firewall
#共享上网,
0 chain=srcnat src-address=192.168.10.0/24 action=masquerade

#80端口影射,之前已经把 连接 MikroTik RouterOS 的端口改为8181
1 chain=dstnat dst-address=218.56.AAA.243 protocol=tcp dst-port=80
action=dst-nat to-addresses=192.168.10.2 to-ports=80

打开网址ip138.com

ip138.com IP查询(搜索IP地址的地理位置)
您的IP地址是:218.56.AAA.243

问题:
218.56.AAA.0/24 网段无法访问我的218.56.AAA.243:80,即上面的80端口影射,但是其他网段的都可以如:202.0.0.0.0/8
需要回流????????????????

还有我自己访问218.56.AAA.243:80的时候,windows必然会通过218.56.AAA.227来访问的。

描述太长了,我有些头晕,但是第二个问题我可以告诉你原因。
虽然你的默认网关(Default Gateway)是192.168.10.1,但是这是要在上面的路由项目中没有目的地址相关路由时才会使用的,而这里上面已经有了关于目的地址的详细路由。
218.56.AAA.224 255.255.255.224 218.56.AAA.227 218.56.AAA.227 20
218.56.AAA.227 255.255.255.255 127.0.0.1 127.0.0.1 20
218.56.AAA.255 255.255.255.255 218.56.AAA.227 218.56.AAA.227 20
而且还是较高的管理距离。