Disable dhcp server for interface lan

43 views
Skip to first unread message

Perry Couprie

unread,
Apr 28, 2020, 6:23:14 AM4/28/20
to OpenWISP
Hi,
I defined a lan interface and it works. I can not find the way to disable the dhcp for the lan interface.
How can i do this.

Greetings from Amsterdam,
Perry

{
    "interfaces": [
        {
            "wireless": {
                "network": [
                    "lan"
                ],
                "mode": "802.11s",
                "radio": "radio0",
                "mesh_id": "Highway",
                "mesh_fwding": 1,
                "mesh_rssi_threshold": 0
            },
            "type": "wireless",
            "name": "mesh0"
        },
        {
            "type": "bridge",
            "bridge_members": [
                "eth0.1",
                "mesh0"
            ],
            "name": "lan",
            "addresses": []
        }
    ]
}


Valere Gille Geovan Noumbissi

unread,
Apr 28, 2020, 6:38:08 AM4/28/20
to open...@googlegroups.com
Hello Perry,
When you leave the addresses key empty, that is leaving "addresses" : [],  it is default to dhcp , to turn this off, you need to manually  supply an address, an example for the address key could look like this;

"addresses": [
                {
                    "proto": "static",
                    "family": "ipv4",
                    "address": "192.168.56.2",
                    "mask": 24,
                    "gateway": ""
                }
            ],

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/cfbb6c24-ee8f-409f-9fd5-77ce0da04d9d%40googlegroups.com.


--
Noumbissi Valere
Message has been deleted

Perry Couprie

unread,
Apr 28, 2020, 6:55:43 AM4/28/20
to OpenWISP
In /etc/config/dhcp i can set the lan interface to ignore.
How can i config /etc/config/dhcp ?

Perry

Valere Gille Geovan Noumbissi

unread,
Apr 28, 2020, 7:09:39 AM4/28/20
to open...@googlegroups.com
I don't think you need to edit /etc/config/dhcp to achieve this. I think the best way will be to tweak your interface configuration above  to achieve this.

I am not saying your lan config above is incorrect. It is perfectly correct (to work with dhcp). to disable the dhcp for the interface, you will need to provide a static address to the "addresses" field. the schema can't take an empty address. so when you leave it empty like you did in your config, the system defaults it to dhcp. if you wish to deactivate this, you need to explicitly provide an address which will be use. a typical tweak to your config above will look like this:

{
    "interfaces": [
        {
            "wireless": {
                "network": [
                    "lan"
                ],
                "mode": "802.11s",
                "radio": "radio0",
                "mesh_id": "Highway",
                "mesh_fwding": 1,
                "mesh_rssi_threshold": 0
            },
            "type": "wireless",
            "name": "mesh0"
        },
        {
            "type": "bridge",
            "bridge_members": [
                "eth0.1",
                "mesh0"
            ],
            "name": "lan",
            "addresses": [
                {
                    "proto": "static",
                    "family": "ipv4",
                    "address": "192.168.56.2",
                    "mask": 24,
                    "gateway": ""
                }
            ],
        }
    ]
}
--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.


--
Noumbissi Valere

Perry Couprie

unread,
Apr 28, 2020, 7:25:16 AM4/28/20
to OpenWISP
What is send was the mesh template. In the device config i defined the static ipaddress.
My compleet is as follows. In this setup the router acts a dumb acces point. So i need to disable dhcp on the lan interface.


package system

config system 'system'
	option description 'Test router'
	option hostname 'mesh-node-kantoor'
	option maintainer 'XXXXXXXXXXXXXXX'
	option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
	option zonename 'Europe/Amsterdam'

package network

config interface 'lan'
	list bridge_members 'eth0.1'
	list bridge_members 'mesh0'
	list dns_servers '8.8.8.8'
	list dns_servers '8.8.4.4'
	option gateway '192.168.100.1'
	option ifname 'lan'
	option ipaddr '192.168.100.152'
	option netmask '255.255.255.0'
	option proto 'static'

config interface 'mesh0'
	option ifname 'mesh0'
	option proto 'none'

package wireless

config wifi-device 'radio0'
	option channel '6'
	option disabled '0'
	option htmode 'HT20'
	option hwmode '11g'
	option legacy_rates '0'
	option noscan '1'
	option txpower '20'
	option type 'mac80211'

config wifi-iface 'wifi_mesh0'
	option device 'radio0'
	option ifname 'mesh0'
	option mesh_fwding '1'
	option mesh_id 'Highway'
	option mesh_rssi_threshold '0'
	option mode 'mesh'
	option network 'lan'


João Henrique Albuquerque

unread,
Apr 28, 2020, 7:30:57 AM4/28/20
to open...@googlegroups.com
Worst case scenario you can try to overwrite the /etc/config/dhcp file for something it works for you.



--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.

Perry Couprie

unread,
Apr 28, 2020, 8:47:13 AM4/28/20
to OpenWISP
I need to generate the following:

package dhcp                                                   
                                                               
config dhcp 'lan'                                              
        option ignore '1'         

Federico Capoano

unread,
Apr 28, 2020, 10:33:29 AM4/28/20
to OpenWISP
Hi Perry,

so, you need to disable the DHCP server, I think the other users understood DHCP client.

This should be what you need:

{
    "dhcp": [
        {
            "config_name": "dhcp",
            "config_value": "lan",
            "ignore": true
        }
    ]


I leave a couple of pointers that would help you to solve this for future reference:

- Backward conversion tool (from native OpenWRT to NetJSON):
# convert an OpenWRT tar.gz to NetJSON and print to standard output (with 4 space indentation)
netjsonconfig --native config.tar.gz --backend openwrt --method json -a indent="    "
Example taken from: http://netjsonconfig.openwisp.org/en/latest/general/commandline_utility.html
I hope this helps.

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages