Lost connection after NVRAM programming

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 4:42    Post subject: Lost connection after NVRAM programming Reply with quote
Hi,
I programmed the nvram with the following and lost connection to the DDWRT router. How can I fix it?

nvram set vlan1ports="2 3 5*"
nvram set vlan20ports="4 5u"
nvram set vlan30ports="4t 5"
nvram set port0vlans="20 18 19 21"
nvram set port1vlans="20 18 19 21"
nvram set port2vlans="1 18 19 21"
nvram set port3vlans="1 18 19 21"
nvram set port4vlans="2 18 19 21"
vnram set port5vlans="1 2 20 30 16"
nvram set vlan20hwname=eto
nvram set vlan30hwname=et0

nvram commit

I am able to put back the factory firmware and regain the connection. But I am not able to regain the control of it if i put the DDWRT firmware to it.

Any suggestion is appreciated.
Sponsor
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5660

PostPosted: Mon Feb 15, 2021 4:57    Post subject: Reply with quote
Did you perform a hardware reset? Most modern routers are to hold the reset button for 10 seconds.

But I do not know which model and version router you are talking about, nor which DD-WRT build.

An alternative to hardware reset is nvram erase && reboot from Telnet as root if running a modern build.

I am guessing D-Link DIR-868L Rev.A1 or D-Link DIR-890L? r44715?


Last edited by blkt on Mon Feb 15, 2021 5:11; edited 2 times in total
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Feb 15, 2021 4:58    Post subject: Reply with quote
Router model, build number, and exact steps to reproduce might help us help you.
_________________
"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
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 5:26    Post subject: Reply with quote
hi,
The model is Dlink-868L A1

I do not know the ip address of the router. I tried 192.168.1.1 and 192.168.0.1.

I am not able to do SSH to erase the nvram as I am not able to establish a connection to it.

I tried reset, put back factory firmware and reprogram it back to DD-WRT r45711.

No success Sad

I made a SSH connection to the router, then programed it and end with a reboot command, After that, I lost the connection.

On the computer, network status, I saw only ipv6 information:
uov6 address: fe80:21a8:976f:4225:e438%12
ipv6DNS fec0:0:0:0:1%1

I am not able to establish a ipv4 connection if loaded with DDWRT firmware.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5660

PostPosted: Mon Feb 15, 2021 5:31    Post subject: Reply with quote
Telnet to 192.168.1.1 and nothing happens?
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 5:55    Post subject: Reply with quote
Thank you for your suggestion.
I have been using the ethernet to do all the programming and testing. It was the ethernet not able to establish the connection.
Luckly, the wifi was still working and I was able to establish the connection to open the SSH service.

I reprogram the nvram to the original default setting. Now the ethernet is back to normal.

Thank you for all the attention.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6411
Location: UK, London, just across the river..

PostPosted: Mon Feb 15, 2021 7:50    Post subject: Reply with quote
recently, on a Broadcom router (R7000), i was able to create a vlan 3, an extra VLAN on additional bridge, very easy via GUI, i can give you all my steps to try...it..(its only for a 1 Vlan, but idea is the same for more, to add later)

in my case for my surprise, its working as it should...

1. Set up>Switch Config> create a vlan, click on the box VLAN 3, any port you want to remove from VLAN 1 (there must be 4 ports up on VLAN1) on the very right side (assigned to bridge leave to none) ... save & apply
2. Reboot
3. Set up>networking create a br1 save & apply reboot
4. Set up>networking>assign to bridge br1 vlan3 save & apply
5. Leave Vlan3 to default, find br1, enable NAT,Filter WAN NAT, and Net Isolation and give it an IP use /24 mask, as the other masks are not working with vlan setup yet, at least i tried few with no avail
6. Create dhcpd for br1 and reboot
7. Add to firewall script:
iptables -t nat -A POSTROUTING -s 192.168.x.x/24 -o $(get_wanface) -j MASQUERADE replace 192.168x.x with yr
iptables -I FORWARD -i br1 -o $(get_wanface) -m state --state NEW -j REJECT - kill switch for the new vlan
iptables -I INPUT -i br1 -p tcp --dport 80 -j REJECT - to cut off GUI access on this bridge
iptables -I INPUT -i br1 -p tcp --dport 443 -j REJECT - to cut off GUI access on this bridge
iptables -A INPUT -i br1 -p udp --dport 502 -j DROP - this is mandatory firewall rule
iptables -I FORWARD -i br1 -o br0 -m state --state NEW -j REJECT
iptables -I FORWARD -i br0 -o br1 -m state --state NEW -j REJECT

once again i did it all via GUI, no start up script was used, as i normally do with Atheros..
so, it seems GUI option was working on Broadcom (R7000), do keep in mind on your router Switch Config tab may look different, if so the basics are the same...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 15:44    Post subject: Reply with quote
Hi Alozaros,
Thank you for your suggestion. I looked into this method before. But the Dlink DIR868L router will be running in AP mode with 2 switch ports set as VLAN20 for IP camera connection.
The primary router is up and running with vlan1,vlan20 (Cam) and vlan30(IoT) already. I would like to program the DIR868L to work with the primary router rather than the other way round. DDWRT GUI method has VLAN# up to 16 only.

Losing the ethernet connection was unexpected, I will try the startup script method, at least I can reset the router to default setting with a RESET button.
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Feb 15, 2021 16:12    Post subject: Reply with quote
If you are configuring as a wired AP or switch only per the wiki, then you should be trying to connect to the NEW ip address you configured.

https://wiki.dd-wrt.com/wiki/index.php/Linking_Routers

https://wiki.dd-wrt.com/wiki/index.php/Wireless_access_point

https://wiki.dd-wrt.com/wiki/index.php/Switch

_________________
"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
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 20:22    Post subject: Reply with quote
Hi All,
I have the DIR868L wire linked (WAN port) to the primary router.
WAN disabled, DHCP disabled, Assigned WAN Port to Switch not checked.

I would like to have the DIR686 configured as :
-Wired AP at WAN port
-switch port 3 & 4 as dafault VLAN 1
-switch port 1 & 2 as Cam VLAN 20
-AP through bridge to IoT VLAN 30

I have the start up script as folllow:
# Clear VLAN 0
echo "" > /proc/switch/eth0/vlan/0/ports

# Configure VLAN 1 with LAN port 2, 3 and CPU port
echo "2 3 5*" > /proc/switch/eth0/vlan/1/ports

# Configure VLAN 2 with WAN and CPU port
echo "4 5u" > /proc/switch/eth0/vlan/2/ports

# Configure VLAN 20 Cam with LAN port 0, 1 and CPU port
echo "0 1 5" > /proc/switch/eth0/vlan/20/ports

# Configure VLAN 30 Cam with WAN and CPU port(for VAP Bridge)
echo "4t 5" > /proc/switch/eth0/vlan/30/ports

# Setting up VLAN interfaces ...

# Setup vlan20 interface
/sbin/vconfig add eth0 20
/sbin/ifconfig vlan20 up
/sbin/ifconfig vlan20 txqueuelen 0

# Setup vlan30 interface
/sbin/vconfig add eth0 30
/sbin/ifconfig vlan30 up
/sbin/ifconfig vlan30 txqueuelen 0

At switch port 3 & 4 (VLAN 1), I can get ip address from primary router, but not for port 1 & 2 (VLAN 20)

If I change the VLAN setting, port 1 & 2 (VLAN 20) is enable, but not 3 & 4 (VLAN 1).

Yours assistance is appreciated.
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Feb 15, 2021 20:42    Post subject: Reply with quote
If you're plugged into the WAN port to link to the primary router, you have to assign the WAN port to the switch or it won't work. Now, does the primary router have the proper configuration to assign IPs to VLANs 20 and 30?
_________________
"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
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 21:20    Post subject: Reply with quote
Hi,
The checked WAN port to Switch does not make a difference.
Now it is checked.
Between the primary router to DIR868, there is a managed switch. The link is set as trunk from switch to the DIR868L.

At this moment, switch port 3 n 4 (VLAN 1), the PC can get a ip from the primary router in the range 192.168.2.x. but not port 1 and 2 (VLAN 20)

If I change the VLAN setting, switch port 1 and 2 will get an ip address from primary router in the range 192.168.20.x. but port 3 and 4 (VLAN 1) will lost connection ie no ip address.

The primary router is working fine to assaign VLAN 20 ip address to all the ip camera on the network thought the managed switch. 192.168.20.x.

The VLAN 30 is solely to be used on the DIR868L AP.

I wonder how I can config the DIR868L WAN port/LAN port #4 correctly as a trunk port. ie for VLAN 1, VLAN 20 and VLAN 30.
kernel-panic69
DD-WRT Guru


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

PostPosted: Mon Feb 15, 2021 21:31    Post subject: Reply with quote
What is wrong with this picture?

Quote:
# Configure VLAN 2 with WAN and CPU port
echo "4 5u" > /proc/switch/eth0/vlan/2/ports


Whatever port you are using to uplink must have all the VLANs assigned to it, if I am thinking correctly. That line completely negates the setting of WAN port to switch, if I am not mistaken. I could be wrong.

_________________
"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
Pat_Rich
DD-WRT Novice


Joined: 05 Nov 2020
Posts: 33

PostPosted: Mon Feb 15, 2021 22:30    Post subject: Reply with quote
Yes, Also DIR868L is function as a managed switch. there is no need to keep the WAN VLAN 2.
I have modified the start up script as follow. Now it is working as it should be, switch port 1 n 2 VLAN 1, ip 192.168.2.x, switch port 3 n 4 VLAN 20, ip 192.168.20.x.

Next step is to do the bridge for VLAN 30 to the VAP.

The managed switch start up script with default VLAN and VLAN 20 and VLAN 30.
WAN Disabled
DHCP Disabled
Assign WAN to Switch port checked

# Clear VLAN 0 and 2
echo "" > /proc/switch/eth0/vlan/0/ports
echo "" > /proc/switch/eth0/vlan/2/ports

# Configure VLAN 1 with LAN port 2, 3 4 and CPU port
echo "2 3 4 5*" > /proc/switch/eth0/vlan/1/ports

# Configure VLAN 20 Cam with LAN port 0, 1 4 and CPU port
echo "0 1 4t 5" > /proc/switch/eth0/vlan/20/ports

# Configure VLAN 30 Cam with WAN and CPU port(for VAP Bridge)
echo "4t 5" > /proc/switch/eth0/vlan/30/ports

# Setting up VLAN interfaces ...

# We don't need the vlan2 interface now ...

/sbin/ifconfig vlan2 down
/sbin/vconfig rem vlan2

# Setup vlan20 interface
/sbin/vconfig add eth0 20
/sbin/ifconfig vlan20 up
/sbin/ifconfig vlan20 txqueuelen 0

# Setup vlan30 interface
/sbin/vconfig add eth0 30
/sbin/ifconfig vlan30 up
/sbin/ifconfig vlan30 txqueuelen 0

Kernel-panic69, Thank you for your assistance
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    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