【阿里云鏡像】使用VM虛擬機(jī)安裝OpenWRT并更換阿里云鏡像源

【阿里云鏡像】使用VM虛擬機(jī)安裝OpenWRT并更換阿里云鏡像源
一、參考鏈接二、
OpenWRT簡(jiǎn)介
三、使用VM虛擬機(jī)安裝OpenWRT操作步驟
1、下載OpenWRT.img鏡像源
2、將.img鏡像文件轉(zhuǎn)換成.vmdk虛擬硬盤(pán)格式文件
(1)打開(kāi)StarWind V2V Image Converter
(2)選擇將要轉(zhuǎn)換的鏡像文件存儲(chǔ)的位置
(3)選擇源鏡像文件
(4)選擇轉(zhuǎn)換格式
(5)選擇磁盤(pán)格式
(6)確認(rèn)信息,開(kāi)始轉(zhuǎn)換
(7)轉(zhuǎn)換完成
3、使用VM虛擬機(jī)創(chuàng)建OpenWRT
① 選擇的客戶機(jī)操作系統(tǒng)如下圖所示
② 使用NAT地址轉(zhuǎn)換模式
③ 選擇磁盤(pán),為剛剛轉(zhuǎn)換過(guò)后的.vmdk磁盤(pán)格式文件
④ 創(chuàng)建完成,點(diǎn)擊“開(kāi)啟此虛擬機(jī)”
⑤ 登錄成功
4、修改網(wǎng)絡(luò)參數(shù)信息并SSH連接
5、訪問(wèn)OpenWRT的WEB界面,輸入配置的IP地址即可
四、更換阿里OpenWRT鏡像源
五、總問(wèn)題反饋

一、參考鏈接

阿里巴巴開(kāi)源鏡像站-OPSX鏡像站-阿里云開(kāi)發(fā)者社區(qū) (aliyun.com)

openwrt鏡像-openwrt下載地址-openwrt安裝教程-阿里巴巴開(kāi)源鏡像站 (aliyun.com)

VMware安裝OpenWrt讓宿主機(jī)上網(wǎng)&旁路由(兩種方案)Algorithm的博客-CSDN博客vmware 旁路由

VM虛擬機(jī)搭建openwrt系統(tǒng)環(huán)境配置和使用weixin_41782780的博客-CSDN博客openwrt vm

二、OpenWRT簡(jiǎn)介

OpenWRT(曾用名 LEDE)是一款廣泛應(yīng)用于路由器的嵌入式操作系統(tǒng)。本站提供 OpenWRT 的包管理器 opkg的鏡像,以加快國(guó)內(nèi)訪問(wèn)速度。

三、使用VM虛擬機(jī)安裝OpenWRT操作步驟

1、下載OpenWRT.img鏡像源

下載地址:https://mirrors.aliyun.com/openwrt

image-20211219145914763

2、將.img鏡像文件轉(zhuǎn)換成.vmdk虛擬硬盤(pán)格式文件

所需工具為:StarWind V2V Image Converter

(1)打開(kāi)StarWind V2V Image Converter

image-20211219150359357

(2)選擇將要轉(zhuǎn)換的鏡像文件存儲(chǔ)的位置

(選擇Local file)本地文件夾

image-20211219150534801

(3)選擇源鏡像文件

image-20211219150618775

(4)選擇轉(zhuǎn)換格式

image-20211219150654650

(5)選擇磁盤(pán)格式

image-20211219150718266

(6)確認(rèn)信息,開(kāi)始轉(zhuǎn)換

image-20211219150745518

(7)轉(zhuǎn)換完成

image-20211219150830039

3、使用VM虛擬機(jī)創(chuàng)建OpenWRT

部分關(guān)鍵截圖如下圖所示

① 選擇的客戶機(jī)操作系統(tǒng)如下圖所示

image-20211219151033407

② 使用NAT地址轉(zhuǎn)換模式

image-20211219151135165

③ 選擇磁盤(pán),為剛剛轉(zhuǎn)換過(guò)后的.vmdk磁盤(pán)格式文件

image-20211219151308758
image-20211219151333701
image-20211219151424001

④ 創(chuàng)建完成,點(diǎn)擊“開(kāi)啟此虛擬機(jī)”

image-20211219151527356

⑤ 登錄成功

image-20211219151648444

4、修改網(wǎng)絡(luò)參數(shù)信息并SSH連接

 root@OpenWrt:~# vi /etc/config/network
 root@OpenWrt:~# cat /etc/config/network
 
 config interface 'loopback'
  option device 'lo'
  option proto 'static'
  option ipaddr '127.0.0.1'
  option netmask '255.0.0.0'
 
 config globals 'globals'
  option ula_prefix 'fd33:8f52:e9fd::/48'
 
 config device
  option name 'br-lan'
  option type 'bridge'
  list ports 'eth0'
 
 config interface 'lan'
  option device 'br-lan'
  option proto 'static'
  option ipaddr '192.168.200.50'
  option netmask '255.255.255.0'
  option ip6assign '60'
 
 root@OpenWrt:~# ip a
 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  inet 127.0.0.1/8 scope host lo
  valid_lft forever preferred_lft forever
  inet6 ::1/128 scope host
  valid_lft forever preferred_lft forever
 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
  link/ether 00:0c:29:b4:2f:04 brd ff:ff:ff:ff:ff:ff
 5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
  link/ether 00:0c:29:b4:2f:04 brd ff:ff:ff:ff:ff:ff
  inet 192.168.200.50/24 brd 192.168.200.255 scope global br-lan
  valid_lft forever preferred_lft forever
  inet6 fd33:8f52:e9fd::1/60 scope global noprefixroute
  valid_lft forever preferred_lft forever
  inet6 fe80::20c:29ff:feb4:2f04/64 scope link
  valid_lft forever preferred_lft forever
 root@OpenWrt:~#
 _________________________________________________________________
 
 C:\Users\xybdiy>ssh root@192.168.200.50
 The authenticity of host '192.168.200.50 (192.168.200.50)' can't be established.
 ED25519 key fingerprint is SHA256:uINCvTddAyG9bGGRCD/5R2b7DSmUoxLDcyNe4Pcr9OA.
 Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
 Warning: Permanently added '192.168.200.50' (ED25519) to the list of known hosts.
 
 
 BusyBox v1.33.1 (2021-10-24 09:01:35 UTC) built-in shell (ash)
 
  _______                     ________        __
  |       |.-----.-----.-----.|  |  |  |.----.|  |_
  |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
  |_______||   __|_____|__|__||________||__|  |____|
  |__| W I R E L E S S   F R E E D O M
  -----------------------------------------------------
  OpenWrt 21.02.1, r16325-88151b8303
  -----------------------------------------------------
 === WARNING! =====================================
 There is no root password defined on this device!
 Use the "passwd" command to set up a new password
 in order to prevent unauthorized SSH logins.
 --------------------------------------------------
 root@OpenWrt:~#

5、訪問(wèn)OpenWRT的WEB界面,輸入配置的IP地址即可

image-20211219152730428
image-20211219152743381

四、更換阿里OpenWRT鏡像源

手工替換 登錄到路由器,并編輯 /etc/opkg/distfeeds.conf文件,

將其中的downloads.openwrt.org 替換為 mirrors.aliyun.com/openwrt`即可。

快捷替換 執(zhí)行如下命令自動(dòng)替換

 sed -i 's_downloads.openwrt.org_mirrors.aliyun.com/openwrt_' /etc/opkg/distfeeds.conf

操作過(guò)程如下:

 root@OpenWrt:~# cat /etc/opkg/distfeeds.conf
 src/gz openwrt_core https://downloads.openwrt.org/releases/21.02.1/targets/x86/64/packages
 src/gz openwrt_base https://downloads.openwrt.org/releases/21.02.1/packages/x86_64/base
 src/gz openwrt_luci https://downloads.openwrt.org/releases/21.02.1/packages/x86_64/luci
 src/gz openwrt_packages https://downloads.openwrt.org/releases/21.02.1/packages/x86_64/packages
 src/gz openwrt_routing https://downloads.openwrt.org/releases/21.02.1/packages/x86_64/routing
 src/gz openwrt_telephony https://downloads.openwrt.org/releases/21.02.1/packages/x86_64/telephony
 root@OpenWrt:~# sed -i 's_downloads.openwrt.org_mirrors.aliyun.com/openwrt_' /etc/opkg/distfeeds.conf
 root@OpenWrt:~# cat /etc/opkg/distfeeds.conf
 src/gz openwrt_core https://mirrors.aliyun.com/openwrt/releases/21.02.1/targets/x86/64/packages
 src/gz openwrt_base https://mirrors.aliyun.com/openwrt/releases/21.02.1/packages/x86_64/base
 src/gz openwrt_luci https://mirrors.aliyun.com/openwrt/releases/21.02.1/packages/x86_64/luci
 src/gz openwrt_packages https://mirrors.aliyun.com/openwrt/releases/21.02.1/packages/x86_64/packages
 src/gz openwrt_routing https://mirrors.aliyun.com/openwrt/releases/21.02.1/packages/x86_64/routing
 src/gz openwrt_telephony https://mirrors.aliyun.com/openwrt/releases/21.02.1/packages/x86_64/telephony
 root@OpenWrt:~#

五、總結(jié)與問(wèn)題反饋

暫未解決使用VM虛擬機(jī)創(chuàng)建的OpenWRT系統(tǒng),使其能夠訪問(wèn)外網(wǎng),已經(jīng)嘗試多種方法,依舊不行。問(wèn)題先留存,待解決。

 root@OpenWrt:~# ping qq.com
 ping: bad address 'qq.com'
 root@OpenWrt:~#</pre>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容