Sign inSign up

shiyu1314/onecloud

By shiyu1314

Updated about 3 years ago

玩客云(S805) Docker版OpenWRT固件

Image
9

983

shiyu1314/onecloud repository overview

image

🔵创建网络

docker network create -d macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 -o parent=eth0 macnet

🔘[↑自己根据 玩客云 所在网段修改,如:玩客云IP:192.168.1.175,则192.168.0.0/24 改成 192.168.1.0/24,192.168.0.1改成主路由地址]

🔵拉取 OpenWRT 镜像

docker pull shiyu1314/onecloud:latest

🔵创建容器

docker run -itd --name=openwrt --restart=always --network=macnet --privileged=true shiyu1314/onecloud:latest /sbin/init

🔘--name=openwrt 其中openwrt是容器名称,可以更改成你想要的,容器名称注意不要和其他容器一样,会冲突

🔵配置openwrt

docker exec -it openwrt sh

vi /etc/config/network

config interface 'lan'

option type 'bridge'

option ifname 'eth0'

option proto 'static'

option ipaddr '192.168.1.3'#openwrt的ip如路由器的ip是192.168.0.1把192.168.1.3改192.168.0.3

option netmask '255.255.255.0'

option ip6assign '60'

option gateway '192.168.1.1'#路由器的ip如你路由器是192.168.0.1把192.168.1.1改192.168.0.1

option broadcast '192.168.2.255'

option dns '192.168.1.1'#路由器的ip如你路由器是192.168.0.1把192.168.1.1改192.168.0.1

🔵重启网络

/etc/init.d/network restart

🔵主路由 DHCP 设置 将主路由的 DHCP 的默认网关和 DNS 服务器设置 openwrt的ip

🔵修复宿主无网络

vi /etc/network/interfaces

auto eth0

iface eth0 inet manual

auto macvlan

iface macvlan inet dhcp

hwaddress 00:22:bc:fb:45:54

pre-up ip link add macvlan link eth0 type macvlan mode bridge

post-down ip link del macvlan link eth0 type macvlan mode bridge

🔘管理密码是 password

Tag summary

Content type

Image

Digest

sha256:1af0cdc44

Size

121.8 MB

Last updated

about 3 years ago

docker pull shiyu1314/onecloud