N
N
ne555n2014-01-21 19:58:07
linux
ne555n, 2014-01-21 19:58:07

Router with OpenWrt - abnormal behavior

Given: a router with OpenWrt on board (TP-Link MR3020); An ADSL modem that distributes the Internet via Wi-Fi - in fact, raises the WLAN.
Task: Configure the router as a client with a static ip both via cable and via Wi-Fi.
Issues: Configs below. Everything works via Ethernet. But there is a problem with connecting to WLAN. Wi-Fi rises on the router, ifconfig says that the correct address has been assigned to the device (the one that I wrote in the config). But here on a network behind this address nothing responds/responds. In the web face of the modem, in the list of devices connected to the WLAN, my router appears (the MAC address is the same), but for some reason with ip 0.0.0.0
What's the matter?
Configs (partially):

network:
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan'
option ifname 'eth0'
option netmask '255.255.255.0'
option proto 'static'
option ipaddr '192.168.1.5'
config interface 'wlan'
option proto 'static'
option ifname 'wlan0'
option netmask '255.255.255.0'
option ipaddr '192.168.1.6'
option gateway '192.168.1.1'
option dns '192.168.1.1'
wireless:
config wifi-iface
option device 'radio0'
option network 'wlan'
option mode 'sta'
option ssid 'имя домашней сети'
option encryption 'psk'
option key 'пароль от домашней сети'

192.168.1.1 - address of the modem distributing Wi-Fi 192.168.1.6
- preferred address for the router pings for this address.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
Yuriy Andamasov, 2014-01-21
@syncer

at a minimum, if you need to have access to the same network with both client wi-fi and a cable in the internet port, you need to make a bridge between the interfaces

M
mayorovp, 2014-01-22
@mayorovp

I figured out what the problem is. The wlan settings block is shared between "wire" and Wi-Fi, right? It turns out that two network interfaces must have the same address. And you can't do that.
You must either set different addresses for the interfaces - or disable one of them automatically when connecting the cable. The first is simpler...
Another option is to put the wired interface in the bridge with the wireless one, and assign an address to the entire bridge. But then it will be necessary to prohibit transit packets between them at the firewall level - otherwise hello ring!

M
mayorovp, 2014-01-22
@mayorovp

Probably a problem with the modem. He may simply not allow you to cling to his wireless network with static settings ...

A
Armenian Radio, 2016-10-20
@gbg

Why do you need static addresses? If you want the IP not to change, make a reservation by MAC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question