POPPUR爱换
标题:
如何设置ros里面外网的ip
[打印本页]
作者:
china0322
时间:
2010-9-28 21:19
标题:
如何设置ros里面外网的ip
用的版本是ros2.97,是托朋友装的系统!
用的是一个集成网上加三块pci网卡,三块pci网上作为内网卡已经全部设好!
但集成的那块作为外网,在设ip时,却出了问题:
假设我可用的外网ip是210.4.190.52--210.4.190.59,其中210.4.190.53是外网网关。
下面这三个要怎么填写,才能上网
Address:
Network:
Broadcast:
作者:
china0322
时间:
2010-9-28 21:22
自己顶一下,以免帖子沉得快
作者:
china0322
时间:
2010-9-28 21:23
自己顶一下,以免帖子沉得快
作者:
黄石的孩子
时间:
2010-9-28 22:12
这个还是去天下网盟或者是网管联盟是提问比较好
作者:
aboutblank
时间:
2010-9-28 22:27
楼主你应该提供一下子网掩码, 不然的话广播地址没办法确定. 如果根据你提供的网段来看, 我大胆推定使用29位掩码. 这样的话:
Address: 210.4.190.54 到 210.4.190.58 随便写一个
Network: 210.4.190.53
Broadcast: 210.4.190.59
事实上你应该是只需要写 Address 一栏并带上掩码就可以了, 比如这样
/ip address add address=210.4.190.54/29 interface=xxxxxx
剩下的网络号和广播地址都是可以通过IP地址和掩码而确定出来的, 不需要手填.
其中的 xxxxxx 是你外网网卡的名字, 不清楚的话, 可以用 /interface ethernet print 查看一下.
网关方面, 不是在这里写. 而是要通过
/ip route add gateway=210.4.190.53
这样来添加
作者:
aboutblank
时间:
2010-9-28 22:37
对了, 如果要带其他机器上网, 还要做一下NAT. 假设你三块内网网卡的地址设置为 10.0.0.1, 172.16.0.1, 192.168.0.1, 子网掩码都设成了 255.255.255.0, 那么需要添加以下三条 NAT 条目:
/ip firewall nat add chain=srcnat action=masquerade src-address=10.0.0.0/24 out-interface=xxxxxx
/ip firewall nat add chain=srcnat action=masquerade src-address=172.16.0.0/24 out-interface=xxxxxx
/ip firewall nat add chain=srcnat action=masquerade src-address=192.168.0.0/24 out-interface=xxxxxx
其中xxxxxx是你外网网卡的名称.
其实我怀疑用以下一条就能搞定三块网卡:
/ip firewall nat add chain=srcnat action=masquerade src-address=0.0.0.0/0 out-interface=xxxxxx
不过没试过, 不敢乱说...
欢迎光临 POPPUR爱换 (https://we.poppur.com/)
Powered by Discuz! X3.4