D
D
dlinyj2013-01-09 17:13:32
Computer networks
dlinyj, 2013-01-09 17:13:32

OpenWRT network interface alias with dhcp + small questions

Colleagues, there is a router running on the basis of OpenWRT.

Question one: network alias.
Due to the specifics, the router has 5 physical interfaces: eth0, lan1, lan2, lan3, lan4.

Why such names?
I draw your attention to the fact that these are the names of physical interfaces
. Due to the specifics of the piece of iron, it so happened that the kernel was configured with such names. Let them not bother us


I managed to configure all interfaces to a static ip address using the /etc/config/network config :
config
config interface loopback
	option ifname lo
	option proto static
	option ipaddr 127.0.0.1
	option netmask 255.0.0.0

config interface lan0
	option ifname eth0
	option proto static
	option ipaddr	192.168.1.1
	option netmask	255.255.255.0

config interface sp
	option ifname   lan1
	option proto    dhcp

config interface lan2
	option ifname   lan2
	option proto    static
	option ipaddr   192.168.2.2
	option netmask  255.255.255.0


config interface lan3
	option ifname   lan3
	option proto    static
	option ipaddr   192.168.5.3
	option netmask  255.255.255.0

# lan4 not use



The most interesting is the lan1 interface . The task is to have a dhcp client on the main interface (which works successfully with the current config) and! have an alias with a physical address of 192.168.0.2. And here the plug begins!

Using ifconfig , this alias is raised simply:
ifconfig lan1:0 192.168.0.2

That's it, alias is up and running. But I want to do it through the configuration file /etc/config/network . We climb into the documentation wiki.openwrt.org/doc/uci/network#aliases .
We make the same entry:

config interface sp_alias
	option ifname lan1:0
	option proto static
	option ipaddr 192.168.99.1
	option netmask 255.255.255.0


Reload network settings /etc/init.d/network restart . We look ... And we get a shish with butter. Does not work.
Somewhere in the open spaces of Google (the tenth tab of Google) I found this example:
config interface sp
	option ifname lan1
	option proto dhcp
	option aliases "192.168.0.2/24"


Likewise, it doesn't work.

Who knows how to make an alias through the configuration file?
Yes, I know that it is possible to shove an ifconfig command into boot files, but there is one caveat: another person will not be able to fix this place without digging into the documentation. And you know how we love to read it.

The second question is the program for working with wifi
What program can be used to configure the wifi client? It is required to get a list of networks, connect with a password request, etc. (everything is for OpenWRT).

Third question: dhcp-server on the eth0 interface
Here is a completely noob question, you can just feed the link: how to set up a dhcp-server on the eth0 interface?
Grateful for any help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vitmeat, 2013-01-09
@vitmeat

In general, there are few resources in Russian about OpenWRT, maybe you will find what you need =)
h-wrt.com/ru/doc
we.easyelectronics.ru/Lifelover/prevraschaem-nedorogoy-router-v-domashniy-server.html
habrahabr.ru/post /124744/
dipcore.com/
rascal.su/blog/tag/openwrt/
habrahabr.ru/post/127739/
robocraft.ru/blog/electronics/1053.html

S
sixhundredsixtyfive, 2013-11-19
@sixhundredsixtyfive

The third question: dhcp-server on the eth0 interface Use
standard tools (dnsmasq) to configure dhcp through the /ect/config/dhcp configuration file.
For all interfaces except eth0, add entries
config dhcp 'lan1'
option interface 'lan1'
option ignore '1'
And to be sure, also block 67 and 68 gjhns UDP for all except eth0 using /ect/config/firewall

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question