Account for Wiki needed / could someone update an article?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
78Mhz
DD-WRT Novice


Joined: 31 May 2018
Posts: 13

PostPosted: Mon Jun 04, 2018 11:37    Post subject: Account for Wiki needed / could someone update an article? Reply with quote
Hello folks,

I would like to edit an article about DHCP-Client on LAN for a Wireless Access Point, but I can't register in the wiki.

It is this wiki article: https://wiki.dd-wrt.com/wiki/index.php/Wireless_Access_Point#LAN_Uplink

That script did not work for me, but a similar script by the netguy did. I added some lines from the original script from the wiki to show the values in the web-gui:

The working script for v24-sp2 (08/07/10) std:
Code:

ln -s /sbin/rc /tmp/udhcpc
/usr/sbin/udhcpc -i br0 -p /var/run/udhcpc.pid -s /tmp/udhcpc -H `nvram get router_name`
route add default gw `nvram get wan_gateway`

# Config DNS
/bin/cat /etc/resolv.conf | /bin/grep -v nameserver > /tmp/resolv.conf
/bin/echo nameserver `nvram get wan_get_dns` >> /tmp/resolv.conf
/bin/cp /tmp/resolv.conf /etc/resolv.conf

# Show Values in Web GUI
GW=`route -n|grep UG|awk '{print $2;}'`
IP_LAN=`ifconfig br0 | grep inet | cut -d: -f2 | cut -d' ' -f1`
MSK=`ifconfig br0 | grep inet | cut -d: -f4`


And the working script for v3.0-r33525 std (10/17/17). In the newer firmware udhcpc changed it's location from /usr/sbin/udhcpc to simple /sbin/udhcpc. The webgui does not work with shell variables like the old version but uses variables in the nvram.
Code:

# create a symbolic link, where the program can create a file called
# udhcpc.expires if the symbolic link does not already exists
[ ! -e /tmp/udhcpc ] &&  ln -s /sbin/rc /tmp/udhcpc

# start the dhcp-client on the bridge interface br0 while running scripts
# with the symbolic link created before. the hostname gets querried with
# nvram from the persistent system settings. the default gateway is
# stored by the client in the nvram but the route is not set. the client
# will change the IP of it's interface.
/sbin/udhcpc -i br0 -p /var/run/udhcpc.pid -s /tmp/udhcpc -H `nvram get router_name`
# now set the default gateway
route add default gw `nvram get wan_gateway`

# Config DNS - get the old nameserver into a temporary file
/bin/cat /etc/resolv.conf | /bin/grep -v nameserver > /tmp/resolv_tmp.conf
# put the new nameserver querried by the dhcp-client into the temporary file
/bin/echo nameserver `nvram get wan_get_dns` >> /tmp/resolv_tmp.conf
# make the temporary file permanent
/bin/cp /tmp/resolv_tmp.conf /etc/resolv.conf

# Show Values in Web GUI per nvarm variables
nvram set lan_ipaddr=`ifconfig br0 | grep inet | cut -d: -f2 | cut -d' ' -f1`
nvram set lan_netmask=`ifconfig br0 | grep inet | cut -d: -f4`
nvram set lan_gateway=`route -n|grep UG|awk '{print $2;}'`
nvram set sv_localdns=`nvram get wan_get_dns`


Could please someone update that article?
Sponsor
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2318
Location: Canada

PostPosted: Tue Jun 05, 2018 12:50    Post subject: Wiki access Reply with quote
I can update the wiki. I am trying to figure out which script you are updating.
_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
78Mhz
DD-WRT Novice


Joined: 31 May 2018
Posts: 13

PostPosted: Tue Jun 05, 2018 14:46    Post subject: Reply with quote
Don't update any existing scripts. I guess they will work with some firmware versions.

Just add the new scripts and the information, with what version of DD-WRT they are working.

So a reader can choose the right script for his version.
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2318
Location: Canada

PostPosted: Wed Jun 06, 2018 3:22    Post subject: Section Reply with quote
Which section exactly?
_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Wed Jun 06, 2018 3:49    Post subject: Re: Account for Wiki needed / could someone update an articl Reply with quote
78Mhz wrote:

And the working script for v3.0-r33525 std (10/17/17). In the newer firmware udhcpc changed it's location from /usr/sbin/udhcpc to simple /sbin/udhcpc.



No need to hardcode the full path in the command, /bin , /sbin , /usr/bin , and /usr/sbin are in the command search path.

_________________
Kernel panic: Aiee, killing interrupt handler!
78Mhz
DD-WRT Novice


Joined: 31 May 2018
Posts: 13

PostPosted: Wed Jun 06, 2018 16:53    Post subject: Re: Account for Wiki needed / could someone update an articl Reply with quote
LOM wrote:

No need to hardcode the full path in the command, /bin , /sbin , /usr/bin , and /usr/sbin are in the command search path.

That is good to know. Most scripts I seen until know, had the locations hardcoded.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum