Загрузка...

OpenWrt : Ip static configuration router best OpenWrt

To configure a static IP address on your OpenWrt router, follow this simple and reliable setup. This is useful if you're assigning a fixed IP on your LAN or WAN side for routing, access, or network stability.

✅ GOAL: Set Static IP on LAN or WAN
You can set a static IP for:
🔁 LAN interface (router's local IP for your network)
🌐 WAN interface (if your ISP or upstream requires a fixed IP)

🖥️ How to Set Static IP via LuCI (Web Interface)
🔧 Step 1: Access the Router
Connect to the router (usually http://192.168.1.1)
Login (default user: root, password: custom or blank if first time)

🔹 A. Configure Static LAN IP (recommended for stability)
Go to: Network - Interfaces - LAN - Edit
Under General Settings:
IPv4 address: e.g., 192.168.1.10
IPv4 netmask: 255.255.255.0
IPv4 gateway: (optional for routing, e.g., 192.168.1.1)
DNS: e.g., 8.8.8.8 1.1.1.1
Click Save & Apply
💡 After changing IP, you'll need to re-login to the new router IP (e.g., 192.168.1.10)

🔹 B. Configure Static WAN IP (for internet connection)
Go to: Network - Interfaces - WAN - Edit
Set Protocol to: Static address
Under General Settings:
IPv4 address: IP provided by ISP (e.g., 100.64.1.10)
IPv4 netmask: usually 255.255.255.0
IPv4 gateway: your upstream gateway (e.g., 100.64.1.1)
DNS: e.g., 8.8.8.8, 1.1.1.1
Click Save & Apply

✅ Confirm Configuration
Go to Network - Interfaces — make sure the interface shows "up" with the static IP.

SSH or ping from router:
ping -c 4 8.8.8.8
🔁 CLI Version (Optional)
/etc/config/network (edit via SSH or vi)

Example LAN static IP:
config interface 'lan'
option ifname 'br-lan'
option proto 'static'
option ipaddr '192.168.1.10'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option dns '8.8.8.8 1.1.1.1'
Then apply:
/etc/init.d/network restart

Видео OpenWrt : Ip static configuration router best OpenWrt канала Weart1Media
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки