|
Mikrotik RB450G安装Openwrt
和RB450G一起买的腾达W300A AP坏掉了,这下家里没有无线了,果断入了RB2011UiAS-2HnD。
闲置下来的RB450G没用,但是这个有个优点是可以PoE受电,RB2011第10口正好可以供电,就少了一个电源,还能同开同关。
Routeros做主路由很强大,但是扩展功能不如Openwrt方便,我准备跑DNSscrypt和gae,所以就准备在RB450G上刷Openwrt。
主要是参考:
https://blog.poettner.de/2011/05/27/openwrt-trunk-on-mikrotik-routerboard-411750/ 和 http://wiki.openwrt.org/toh/mikrotik/rb450g 还有这个写教程的时候才看到http://support.chillifire.net/downloads/Chillifire_Hotspot_Router_Installation_Guide_Mikrotik.pdf
首先是准备工作:
因为我没有USB转串口线,所以需要多做一些准备
1、先要进到winbox里面在system/routerboard/setting里面设置dhcp
2、Ubuntu准备,安装需要的软件
sudo apt-get install isc-dhcp-server atftpd
sudo nano /etc/default/isc-dhcp-server 最后的INTERFACES="eth0"要加上你的网卡eth0,用ifconfig看一下是那个。
sudo nano /etc/dhcp/dhcpd.conf 这个改的很多下面是我改的,可以参考下
allow booting;
allow bootp;
# A slightly different configuration for an internal subnet.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.110;
option subnet-mask 255.255.255.0;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
default-lease-time 600;
max-lease-time 7200;
}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
host passacaglia {
hardware ethernet 00:0c:42:ca:89:3e;
filename "openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf";
fixed-address 192.168.1.101;
next-server 192.168.1.2;
# server-name "toccata.fugue.com";
}
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
host fantasia {
hardware ethernet 00:0c:42:ca:89:3e;
fixed-address 192.168.1.101;
}
主要是去掉#,别忘了最后的“}”
sudo nano /etc/default/atftpd 就第一行 USE_INETD=false
3、把启动映像考到atftpd里,位置是/srv/tftp/,
启动映像是https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/mikrotik/里面带有initramfs的elf
openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf sudo cp openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf /srv/tftp/
4、重启DHCP
cd /etc/init.d/
sudo ./isc-dhcp-server restart
这时通过syslog可以看到失败dhcpd: No subnet declaration for eth0 (no IPv4 addresses).这个这个正常因为在网卡没连线的时候就是这样。syslog有个查看器Ubuntu自带软件。
5、安装RB450G的重置按钮加电
并且在命令行sudo ./isc-dhcp-server restart
这时就能看到DHCP重启OK
在syslog里面可以看到(mac码不给看啦)
Jun 13 11:11:25 HP dhcpd: DHCPDISCOVER from 00:00:??:??:??:?? via eth0
Jun 13 11:11:25 HP dhcpd: DHCPOFFER on 192.168.1.101 to 00:00:??:??:??:?? via eth0
Jun 13 11:11:25 HP dhcpd: Dynamic and static leases present for 192.168.1.101.
Jun 13 11:11:25 HP dhcpd: Remove host declaration passacaglia or remove 192.168.1.101
Jun 13 11:11:25 HP dhcpd: from the dynamic address pool for 192.168.1.0/24
Jun 13 11:11:25 HP dhcpd: DHCPREQUEST for 192.168.1.101 (192.168.1.2) from 00:00:??:??:??:?? via eth0
Jun 13 11:11:25 HP dhcpd: DHCPACK on 192.168.1.101 to 00:00:??:??:??:?? via eth0
Jun 13 11:11:25 HP atftpd[983]: Serving openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf to 192.168.1.101:17633
这样就好了
6、telnet 192.168.1.1就能看到openwrt界面了。千万不要断电!!因为现在只在内存里面有openwrt。
7、转到windows,使用WWWFileSharePro软件,将https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/mikrotik/ 里面所有文件都下载下来拷到WWWFileSharePro的共享文件夹里,并且把openwrt-ar71xx-mikrotik-Ath5k-rootfs.tar.gz文件改名为openwrt-ar71xx-mikrotik-rootfs.tar.gz
8、telnet 到192.168.1.1 在openwrt里面运行wget2nand http://192.168.1.2/
会显示类似下面的画面,如果没有错误就是刷好了。
如果显示“tmp/wget2nand already exists”错误就把这个文件夹删掉 rm -R /tmp/wget2nand,因为wget2nand会检测,下过的话就会拒绝运行。
9、重启!
OK装好了!
10、最后还有个问题因为我们在winbox里面改过dhcp,所以你要想用netinstall装回routeros,你就必须要用串口线进到下面的菜单改boot protocol才能装routeros。
11、最后,大家在装之前一定要备份license key ,如果没有备份的话就只能去官网再下了,官网可以下到,但是要你的机器序列号什么的,我下过,但是忘记在哪下了,大家可以搜一下。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|