"udhcpc" failing to get lease for 2nd WAN interfac

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
resolv
DD-WRT Novice


Joined: 19 Apr 2021
Posts: 24

PostPosted: Sat May 29, 2021 7:44    Post subject: "udhcpc" failing to get lease for 2nd WAN interfac Reply with quote
Hello,

Hardware and firmware:
Asus RT-AC88U
DD-WRT v3.0-r46733 std (05/21/21)

I'm setting up a Dual-WAN configuration using the following instructions:
https://wiki.dd-wrt.com/wiki/index.php/Dual%2C_Triple_%28and_probably_quad%29_WAN_with_multiple_active_WAN_links_and_source_routing

Problem:
"udhcpc" succeeds in getting a lease for my first WAN interface (vlan2/wan);
but it fails to get a lease ("leasefail") for my second WAN interface (vlan3/wan2).
I've obviously missed something in my setup, but I don't know what.
Below is the overall setup procedure leading to the problem; followed by the details of my setup.

Setup procedure and problem:
I started with a fresh install of the dd-wrt firmware, with all nvram variables reset, and the JFFS partition enabled and cleaned.
Following the Dual-WAN instructions above, I configured the router.
Power cycled the router, two ISP modems, and computer.
Wire connected the two ISP modems (DSL and cable) to wan=WAN(port:4) and wan2=LAN-1(port:3).
Wire connected the computer to LAN-8.
Then tested.

vlan2/wan is connected to the internet. vlan3/wan2 fails to get a lease.
The wanlogger log file shows:
Code:
May 28 20:06:45 getstatus: unknown status  for wan
May 28 20:06:45 getstatus: unknown status  for wan2
May 28 20:06:45 configroutes: routing all traffic to wan #07 wan
May 28 20:06:45 configroutes: route set to wan
May 28 20:06:45 changewan: Route changed from default to wan at 28May21 200645
May 28 20:06:58 udhcpc-vlan3: config change ip  , gateway
May 28 20:07:01 procmon: heartbeat fail for monitord, restarting #08 monitord
May 28 20:07:07 udhcpc-vlan3: config change ip  , gateway
May 28 20:07:32 monitord: heartbeat fail for linkd wan
May 28 20:07:32 monitord: restarting linkd wan #08 linkd
May 28 20:07:32 linkd: wan configuration 1 1 1024 10 600 #09 linkd
May 28 20:07:32 getstatus: unknown status  for wan2
May 28 20:07:33 monitord: heartbeat fail for linkd wan2
May 28 20:07:33 monitord: restarting linkd wan2 #08 linkd
May 28 20:07:33 linkd: wan2 configuration 5 1 56 6 120 #09 linkd
May 28 20:07:33 linkd: WAN IP not found for wan2
May 28 20:07:37 udhcpc-vlan3: config change ip  , gateway
May 28 20:08:04 monitord: heartbeat fail for linkd wan2
May 28 20:08:04 monitord: restarting linkd wan2 #08 linkd
May 28 20:08:04 linkd: wan2 configuration 5 1 56 6 120 #09 linkd
<continually repeats the last 5 lines>

wan2 is not being given an IP address. So I wrote a simple udhcpc script which lists the variables being passed and assigned.
To look for clues, I ran this script for both WANs (vlan2/wan and vlan3/wan2):
Code:
root@DD-WRT:/jffs/scripts/wan# udhcpc -i vlan2 -p ./vlan2.pid -s ./udhcpc_test_script
udhcpc: started, v1.33.1
$@         = "deconfig"
$#         = "1"
$0         = "./udhcpc_test_script"
$1         = "deconfig"
$HOME      = "/tmp/root"
$PATH      = "/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"
$interface = "vlan2"
udhcpc: sending discover
udhcpc: sending select for <wan address>
udhcpc: lease of <wan address> obtained, lease time 86400
$@         = "bound"
$#         = "1"
$0         = "./udhcpc_test_script"
$1         = "bound"
$HOME      = "/tmp/root"
$PATH      = "/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"
$interface = "vlan2"
$ip        = "<wan address>"
$subnet    = "255.255.255.0"
$router    = "<wan address>
$dns       = "<wan address> <public address>"
$domain    = "Home"
$lease     = "86400"
$serverid  = "<modem-1 address>"

Code:
root@DD-WRT:/jffs/scripts/wan# udhcpc -i vlan3 -p ./vlan3.pid -s ./udhcpc_test_script
udhcpc: started, v1.33.1
$@         = "deconfig"
$#         = "1"
$0         = "./udhcpc_test_script"
$1         = "deconfig"
$HOME      = "/tmp/root"
$PATH      = "/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"
$interface = "vlan3"
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
$@         = "leasefail"
$#         = "1"
$0         = "./udhcpc_test_script"
$1         = "leasefail"
$HOME      = "/tmp/root"
$PATH      = "/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"
$interface = "vlan3"

So I get a lease ("bound") for vlan2/wan, but fail to get a lease ("leasefail") for vlan3/wan2.
Why one, but not the other? What's the difference?
vlan2/wan passes, and is the "factory" WAN interface (WAN remains wan).
vlan3/wan2 fails, and is the "converted" WAN interface (changed from LAN-1 to wan2).
Something is wrong with my vlan3/wan2 conversion, but I don't know what.
So I'm asking for some guidance.

Below is the detailed information on my routers initial setup, and the changes resulting from the Dual-WAN instructions above.

My Asus RT-AC88U router has the following INITIAL configuration (before any changes):
    Broadcom BCM4709C0 (Dual-Core CPU @ 1.4GHz with switch: LANs 1-4, WAN, port connected to Realtek switch, and CPU port)
    Realtek RTL8365MB (switch: LANs 5-8)

Code:
nvram show | grep vlan.*ports | sort
    vlan1ports=0 1 2 3 5 7*
    vlan2ports=4 7u
nvram show | grep vlan.*hwname | sort
    vlan1hwname=et1
    vlan2hwname=et1

    vlan1ports: ports 0, 1, 2 and 3 on the Broadcom switch are LAN-4, LAN-3, LAN-2, and LAN-1, respectively ("swconfig dev switch0 help" verified)
    vlan1ports: port 5 on the Broadcom switch is connected to the Realtek switch (LANs 5-8); and port 7* on the Broadcom switch is the CPU
    vlan2ports: port 4 on the Broadcom switch is the WAN, and port 7u on the Broadcom switch is the CPU

My Asus RT-AC88U router has the following ALTERED configuration (after Dual-WAN changes):
Code:
nvram set vlan1ports="0 1 2 5 7*" && nvram set vlan3ports="3 7u" && nvram set vlan3hwname="et1" && nvram commit #Dual-WAN
nvram set wan2_ifname="vlan3" && nvram set wan2_netmask="255.255.255.0" && nvram commit #Dual-WAN
nvram show | grep vlan.*ports | sort
    vlan1ports=0 1 2 5 7*
    vlan2ports=4 7u
    vlan3ports=3 7u
nvram show | grep vlan.*hwname | sort
    vlan1hwname=et1
    vlan2hwname=et1
    vlan3hwname=et1
nvram show | grep wan2_ | sort
    wan2_ifname=vlan3
    wan2_netmask=255.255.255.0

Here is the INITIAL setup checklist given in the Dual-WAN instructions, along with my actions (>>):
Code:
Single WAN configuration checklist:
    Install an appropriate DD-WRT version, this configuration has been tested on r14929, r15962 and 24345M;
      >> dd-wrt version: r46733
    Internet interface on WAN port;
      >> DONE
    Time server;
      >> Setup->Basic Setup
      >>   NTP Client: Enable
      >>   Time Zone: US/Pacific
    DHCP server;
      >> DEFAULT
      >> Setup->Basic Setup
      >>   DHCP Type: DHCP Server
      >>   DHCP Server: Enable
    Configure static DNS servers – DNS servers must be accessible through all WAN interfaces.;
      >> USE Google DNS servers (ignore ISP servers)
      >> Setup->Basic Setup
      >>   Ignore WAN DNS: CHECK
      >>   Static DNS 1: 8.8.8.8
      >>   Static DNS 2: 8.8.4.4
    DDNS if applicable;
      >> DEFAULT
      >> Setup->DDNS
      >>   DDNS Service: Disable
    Wireless configuration;
      >> DEFAULT
    syslog;
      >> DEFAULT
      >> Services->Services
      >>   Syslogd: Disable
    ssh management;
      >> Services->Services
      >>   SSHd: Enable
    Firewall and configure port mapping;
      >> DEFAULT
    Web access;
      >> DEFAULT
      >> Administration->Management
      >>   Web GUI Management: Disable
    Remote access;
      >> DEFAULT
      >> Administration->Management
      >>   SSH Management: Disable
      >>   Telnet Management: Disable
    Enable cron;
      >> DEFAULT
      >> Administration->Management
      >>   Cron: Enable
    JFFS;
      >> Administration->Management
      >>   Internal Flash Storage: Enable
      >>   Clean Internal Flash Storage: Enable
    SNMP. 
      >> DEFAULT
      >> Administration->Services
      >>   SNMP: Disable


Here is the CHANGE checklist given in the Dual-WAN instructions, along with my actions (>>):
Code:
Set the following NVRAM configuration variables through the nvram set and commit interface:
    ddns?_hostname: Dynamic DNS service hostname for each WAN interface, e.g., ddns2, ddns3;
      >> NOT SET (external DDNS not used)
    ddns?_username: Dynamic DNS service user name;
      >> NOT SET (external DDNS not used)
    ddns?_passwd: Dynamic DNS service password;
      >> NOT SET (external DDNS not used)
    email_admin: E-mail address(es) for administrative messages, e.g., logwatch;
      >> NOT SET (email not used)
    email_dest: E-mail address(es) for event notifications;
      >> NOT SET (email not used)
    email_passwd: E-mail server password;
      >> NOT SET (email not used)
    email_server: E-mail server hostname;
      >> NOT SET (email not used)
    email_user: E-mail server user name;
      >> NOT SET (email not used)
    route_ips: List of IP addresses for Internet routing tests by linkd, addresses should be on separate networks and outside of your ISPs, a null list will inhibit routing tests;
      >> NOT SET (skip routing tests)
    wan?_ipaddr: WAN IP address – static addresses are set by user, dynamic addresses are set by udhcpc, e.g., wan2, wan3;
      >> NOT SET (using udhcpc instead)
    wan?_netmask: WAN interface netmask;
      >> nvram set wan2_netmask="255.255.255.0"
    wan?_ifname: WAN interface name, e.g., vlan2, vlan3.
      >> nvram set wan2_ifname="vlan3"

Set the following /jffs/scripts/wan/global environment variables with a text editor:
    >> USED EXISTING DEFAULTS IN FILENAME "global" (EXISTING DEFAULTS setup is for Dual-WAN)
    WANLIST: List of monitored WAN interfaces, e.g., wan, wan2, wan3;
      >> WANLIST="wan wan2"                #list of monitored wan names
    STATICWANLIST: List of WAN interfaces with static IP addresses – exclude wan;
      >> #STATICWANLIST="wan2 wan3"        #list static IP wan interfaces (exclude wan)  (commented out; using DYNAMIC IP addresses, not STATIC IP addressses)
    DHCPLIST: List of WAN interfaces configured by DHCP; and
      >> DHCPLIST="vlan2 vlan3"            #list of DHCP VLANs
    BASEDHCP: Name of the VLAN configured by the DD-WRT base configuration, usually vlan2.
      >> BASEDHCP="vlan2"                  #base VLAN configurated by dd-wrt

The rest of the setup is just: copy/paste, scp, decompress and link from the Dual-WAN instructions.
Startup:
Code:
sleep 5
udhcpc -i vlan3 -p /var/run/udhcpc-vlan3.pid -s /jffs/scripts/wan/udhcpc-vlan3
sleep 20
/jffs/scripts/wan/clockupdate
/jffs/scripts/dnsupdate
/jffs/scripts/wan/monitord &

Firewall:
Code:
/jffs/scripts/wan/firewall
/jffs/scripts/wan/route

Additional Cron Jobs:
Code:
* * * * * root /jffs/scripts/wan/procmon
5 0,6,12,18 * * * root /jffs/scripts/wan/ddnsupdateall  # delete if not using dynamic DNS
0 10 * * * root /jffs/scripts/wan/clockupdate
0 11 * * * root /jffs/scripts/wan/logwatch
0 0,3,6,9,12,15,18,21 * * * root /jffs/scripts/wan/apprestart

Links:
Code:
mkdir -p /jffs/etc/config
ln /jffs/scripts/wan/linkdupdate /jffs/etc/config/linkdupdate.ipup
(There's a typo here in the instructions.  I fixed it.)

Any suggestions or pointers appreciated.

Thank you for the help.
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6865
Location: Romerike, Norway

PostPosted: Sat May 29, 2021 8:07    Post subject: Reply with quote
Check the switch with swconfig.

You are running a new build that does not use the "vlan1ports" variable any more, but switched to swconfig.

You should be able to configure vlan with the GUI on this build.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Sat May 29, 2021 8:12    Post subject: Reply with quote
The wiki you linked is no longer relevant to any builds past 46446, like most of the wikis you linked in your other thread. I already mentioned this to you in the other thread, I thought, but you create another one about multi-wan. Please keep discussion in ONE thread, and stop following irrelevant wiki articles that are going to have to be edited at some point.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Display posts from previous:    Page 1 of 1
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware 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