Getting Started OpenWrt
Introduction
The OpenWrt Project is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application.
OpenWrt official Website Here .
In this article, I will talk about:
- Compile Openwrt from Source Code.
- Install Openwrt on ProxMox.
- Basic Set-Up for Openwrt.
Compile OpenWrt
Make sure your have a avaiable Linux/MacOS system, offers recommand Ubuntu 18 LTS x64.
Install required packages.
1 2 3
sudo apt-get update sudo apt-get -y install build-essential asciidoc binutils bzip2 curl gawk gettext git libncurses5-dev libz-dev patch python3.5 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf
Getting Source Code and enter direction.
1 2
git clone -b main --single-branch https://github.com/Lienol/openwrt openwrt cd openwrt
Add additional package/plugin to Source Code, such as Passwall.
1
vim feeds.conf.default
Adding src-git at the end of file.
1
src-git passwall https://github.com/xiaorouji/openwrt-passwall
Update the feeds
1 2 3
./scripts/feeds clean ./scripts/feeds update -a ./scripts/feeds install -a
Configure the firmware image
1
make menuconfig
NOTE:
First three menu is very inportance, Please, carefully choose with your correct CPU architecture. For example, x86.
Settings your package/plugins luci-app, such as, luci-app-passwall
Downloading DL library.
1
make -j8 download v=s
Start Compile
1
make -j1 V=s
NOTE: -j1 is followed by the number of threads. Single thread is recommended for the first compilation.
Output path after compilation. openwrt/bin/targets
Installation
Proxmox
Firstly, Upload your compiled IMG File to ProxMox
sftp into ProxMox.
|
|
Uploading
|
|
NOTE:
List local directory.
1 2
sftp> lls openwrt-x86-64-generic-squashfs-combined.img.gz
List remote directory.
1 2
sftp> ls ROSinstall.sh interfaces temp
Secondly, ssh into ProxMox and using the below Script create a new VM.
|
|
Raspberry Pi
https://openwrt.org/toh/raspberry%5Fpi%5Ffoundation/raspberry%5Fpi
Set-up
Change Password
1
passwd
Set Lan IP Address, Gateway and DNS
network -> interface -> edit
Content need to set-up:
- General Settings:
IPv4 IP Address: 192.168.1.252 IPv4 gateway: 192.168.1.253 IPv4 bradcast: 192.168.1.0
- Advantages Settings:
DNS set as public DNS Server: 114.114.114.114, 114,114,115,115
If this Openwrt as your bypass router, please follow at the below settings. LAN Settings: Let lede only be used as a pure bypass route, DHCP and IPv6 are both allocated by the main route.
- DHCP Server -> General Settings -> choose Ignore this interface.
- IPv6 Settings -> RA Service - Disable
- IPv6 Settings -> DHCPv6 Service - Disable
Let lede obtain IPv6 information normally.
add new interface -> name: IPv6; Protocol: DHCPv6 Client Device: @lan -> create interface -> Firewall settings: lan -> create interface.