海运的博客

GNS3和VMware构建网络实验环境

发布时间:July 24, 2012 // 分类:VMware,Cisco // No Comments

实验环境如下:
VMware新建ROS虚拟机,Wan端以桥接方式连接,IP:192.168.1.21,
Lan端以Host-only连接,IP:192.168.40.2
GNS3运行Cisco路由连接ROS Lan端,FastEthernet0/0 IP:192.168.40.3
FastEthernet0/1 IP:192.168.30.1
VMware网络查看:
VMware网络管理.png
配置ROS网卡为host-only:
VMware网卡host-only.png
ROS内配置:

#https://www.haiyun.me
ip address add address=192.168.1.21/24 interface=ether1 
ip address add address=192.168.40.2/24 interface=ether2 
ip route add gateway=192.168.1.1
ip route add dst-address=192.168.30.0/24 gateway=192.168.40.3
ip dns set servers=192.168.1.1
ip firewall nat add chain=srcnat src-address=192.168.40.0/24 action=masquerade 

GNS3工作区,Cloud添加vmnet1(Host-only),并用连接线连接到Router FastEthernet0/0。
GNS3添加VMnet1.png
Router配置:

enable
configure terminal 
interface fastEthernet 0/0
ip address 192.168.40.3 255.255.255.0
no shutdown
exit
interface fastEthernet 0/1
ip address 192.168.30.1 255.255.255.0
no shutdown
ip route 0.0.0.0 0.0.0.0 192.168.40.2
ip name-server 192.168.1.1

Router内Ping测试:

Router#ping 192.168.40.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/24/56 ms
Router#ping 192.168.1.1 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/12 ms
Router#ping www.haiyun.me 
Translating "www.haiyun.me"...domain server (192.168.1.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 184.164.141.188, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 348/354/360 ms

后续也可使用VCPS虚拟PC配合GNS3进行测试。

搭建OpenWRT和ROS网络环境

发布时间:July 24, 2012 // 分类:ROS // No Comments

网络拓扑图如下:
Openwrt和ROS实验环境.jpg
Ros IP、路由、DNS配置:

ip address add address=192.168.1.21/24 interface=ether1 
ip address add address=192.168.0.1/24 interface=ether2 
ip route add gateway=192.168.1.1
ip dns set servers=192.168.1.1

OpenWRT配置192.168.0.1/24路由:

route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.1.21 dev br-lan

ROS配置DHCP服务:

ip pool add ranges=192.168.1.100-192.168.1.254 name=dhcp
ip dhcp-server add address-pool=dhcp interface=bridge-local disabled=no
ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=192.168.1.1

ROS开启NAT转发服务:

ip firewall nat add chain=srcnat src-address=192.168.0.0/24 action=masquerade out-interface=ether1 

ROS软路由常用命令及网络配置

发布时间:July 22, 2012 // 分类:ROS // No Comments

初始化配置命令,可设置IP相关信息

setup

列出所有指令及简短说明:

?

目录切换:

..
#返回上级
/
#返回主目录

IP配置相关命令:

ip address print 
#列出网卡及IP信息
ip address add address=192.168.1.22/255.255.255.0 interface=ether1 
#网卡1增加IP地址
ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1
#设置默认路由
ip dns set servers=192.168.1.1
#设置DNS
ip address remove numbers=0
#删除ID为0的IP

SNAT&DNAT

ip firewall nat add chain=srcnat action=masquerade out-interface=ether1
#SNAT
ip firewall nat add chain=dstnat action=dst-nat protocol=tcp dst-address=192.168.8.8/32 dst-port=80 to-addresses=192.168.1.8
#DNAT

PPPOE/ADSL拨号:

interface pppoe-client add user=user password=www.haiyun.me use-peer-dns=yes add-default-route=yes\
max-mtu=1492 max-mru=1492 interface=ether1-gateway disabled=no

系统管理相关命令:

system reboot 
#重启系统
system shutdown
#关机
system reset-configuration 
#恢复默认设置
system backup save name=20120721.bak
#备份配置文件
system backup load name=20120721.bak.backup
#恢复配置文件

系统监控相关命令:

tool sniffer start
#开启数据监听
tool sniffer stop
#关闭数据监听
tool sniffer packet print 
#列出监控的数的包
interface monitor-traffic ether1 
#监控指定网卡流量
user active print
#显示当前登录用户
ip firewall connection print
#显示当前所有连接
system resource print 
#列出系统资源占用
system resource monitor 
#实时监控资源占用

配置ROS时区及ntp客户端同步时间:

system clock set time-zone-name=Asia/Shanghai 
system ntp client set mode=unicast primary-ntp=202.112.31.197  enabled=yes 

使用winbox升级ROS官方最新版本

发布时间:July 22, 2012 // 分类:ROS // No Comments

winbox和ros升级版本官方下载地址:http://www.mikrotik.com/download
1.下载当前最新版本ROS npk文件,当前最新版本5.19,http://download2.mikrotik.com/routeros-x86-5.19.npk
2.通过winbox连接ros,将下载的程序上传到file。
3.重启路由即自动升级到ROS5.19版本。

分类
最新文章
最近回复
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...