Configure Interfaces

In version 19, install put a network cable in a LAN port on the router, connect the other end to a switch with access to the internet, and the new router now is online.

I've spent hours trying to figure out how to get this new install (21.02.1) online, and can't figure it out.

This has to do with the changes to the 'interfaces' and I can't seem to find where that is documented as well. I'd like to read it later, but now, can someone please simply say how to get this router online.

Thanks for your help.

You appear to be using a DSL Modem/router device. Based on your screenshot, the WAN is expected on the DSL modem connection.

This is not common... can you draw a network diagram. What else is connected to this switch? Where is the internet coming from? Is there an upstream router?

Were you using the device previously as a dumb AP, or was it configured as an actual router?

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/dhcp
cat /etc/config/firewall

and also
ubus call system board

1 Like

@psherman thanks a lot for your very kind help. I'm very sorry I cannot do what you have asked because while waiting for help, I made some changes to the Interfaces section on the router. Now I only get 169.x.x..x addresses. I cannot connect at all to the router. I tried to re-install the original firmware, but of course, that too is impossible. Now I'm at a complete loss. Without a 'reset' switch, I don't know what to do.

@psherman thanks a lot. I'm now back in! Hurray. I have reset the router using the software option by connecting via ssh and running:

firstboot && reboot now

Presently, the router the WAN port is connected to a switch with Internet access using an Ethernet cable. The router is not online. I have done nothing after running the command above.

Here are the outputs of the commands you asked for:

cat /etc/config/network

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fabb:1785:cc65::/48'

config atm-bridge 'atm'
	option vpi '1'
	option vci '32'
	option encaps 'llc'
	option payload 'bridged'
	option nameprefix 'dsl'

config dsl 'dsl'
	option annex 'b'
	option tone 'av'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config device
	option name 'eth0.1'
	option macaddr 

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device
	option name 'dsl0'
	option macaddr

config interface 'wan'
	option device 'dsl0'
	option proto 'pppoe'
	option username 'username'
	option password 'password'
	option ipv6 '1'

config interface 'wan6'
	option device '@wan'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 4 6t'

cat /etc/config/dhcp
config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	option ra_slaac '1'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

cat /etc/config/firewall
config defaults
	option syn_flood	1
	option input		ACCEPT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

config zone
	option name		lan
	list   network		'lan'
	option input		ACCEPT
	option output		ACCEPT
	option forward		ACCEPT

config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
	option masq		1
	option mtu_fix		1

config forwarding
	option src		lan
	option dest		wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
config rule
	option name		Allow-Ping
	option src		wan
	option proto		icmp
	option icmp_type	echo-request
	option family		ipv4
	option target		ACCEPT

config rule
	option name		Allow-IGMP
	option src		wan
	option proto		igmp
	option family		ipv4
	option target		ACCEPT

# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
	option name		Allow-DHCPv6
	option src		wan
	option proto		udp
	option src_ip		fc00::/6
	option dest_ip		fc00::/6
	option dest_port	546
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-MLD
	option src		wan
	option proto		icmp
	option src_ip		fe80::/10
	list icmp_type		'130/0'
	list icmp_type		'131/0'
	list icmp_type		'132/0'
	list icmp_type		'143/0'
	option family		ipv6
	option target		ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Input
	option src		wan
	option proto	icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	list icmp_type		router-solicitation
	list icmp_type		neighbour-solicitation
	list icmp_type		router-advertisement
	list icmp_type		neighbour-advertisement
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Forward
	option src		wan
	option dest		*
	option proto		icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-IPSec-ESP
	option src		wan
	option dest		lan
	option proto		esp
	option target		ACCEPT

config rule
	option name		Allow-ISAKMP
	option src		wan
	option dest		lan
	option dest_port	500
	option proto		udp
	option target		ACCEPT

# allow interoperability with traceroute classic
# note that traceroute uses a fixed port range, and depends on getting
# back ICMP Unreachables.  if we're operating in DROP mode, it won't
# work so we explicitly REJECT packets on these ports.
config rule
	option name		Support-UDP-Traceroute
	option src		wan
	option dest_port	33434:33689
	option proto		udp
	option family		ipv4
	option target		REJECT
	option enabled		false

# include a file with users custom iptables rules
config include
	option path /etc/firewall.user


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	
#	option target	REJECT

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80
#	option proto		tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#	option src		wan
#	option src_dport	22001
#	option dest		lan
#	option dest_port	22
#	option proto		tcp

### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp

@psherman here is a picture of the port you said should be WAN, presently connected to the switch with Internet access.

This is the part that is highly unusual. What is connected immediately upstream of this switch? Is it another router? A cable modem? A DSL modem? Fiber ONT? or an upstream network such what might be provided if you live in an apartment/condo/business building or dorm?

Your device has a built-in DSL modem. Are you certain that the port you are using is actually an ethernet port (as compared to the DSL input port)? What device are you using?

In your screenshot, there is a drop-down menu for the "Device" -- currently at dsl0. What other options are in that menu?

What make / model is the router? It's clearly something with an internal DSL modem, which you're not using, and I assume don't intend to use. Many of these boxes do not have a "WAN" Ethernet port, just the four "LAN" ports. This means you will need to re-purpose one of those LAN ports to be the wan network.

Go to the Network-Switch page and use the button on the bottom left to add a new VLAN numbered 2. Set the CPU port as "tagged" in it, and one of the Ethernet ports as "untagged." Set that Ethernet port to "off" in the original VLAN 1.

Then go to the wan network interface edit and change the protocol to DHCP Client. Change the Device to eth0.2. Plug the Ethernet cable from the source of Internet into the port that you converted. Go back to the switch page and check that the icon changed to "cable plugged in" on that column to make sure you're using the right port.

Then go back to the main status page and check that there is an "IPv4 Upstream" listed. If this IP address is 192.168.1.X, you need to change the LAN network to a different IP in a range that does not conflict, such as 192.168.2.1.

After completing this there should be Internet connectivity.

@psherman @mk24 thanks a lot. @psherman upstream, another openwrt router, which is connected to my dsl router.
Device I'm testing is the Fritzbox 7362 SL.
I will check the menu later and tell you.

@mk24 thanks, Mike. I think we're onto something here. I will do these steps and come back with a report. Many thanks!

This device does not have a dedicated WAN port. The port you may be using for WAN (gray) is actually a DSL modem input (i.e. phone line input, not ethernet).

You will need to take @mk24's advice regarding repurposing one of the LAN ports.

In this case, more than likely you will need to configure your Fritz device as a DHCP client or static IP on the WAN interface. In this case, the WAN interface will be a repurposed LAN port (as mentioned and described by @mk24).

Given that there isn't a dedicated WAN port, chances are that you will not see an ethernet port offered in the drop down menu. However, do let us know what you see.

@mk24 @psherman either I'm doing something very wrong, or this cause is hopeless.

I did what you asked, Mike, but Luci will not save the changes in both sections, it reverts back to what it was.

Here are shots of the changes, as I made them.



Thanks a lot. I'm hopeful. I'm learning my lesson on routers with modem ports.

@psherman @mk24 here are all the 'devices' on the device :slight_smile:

The reason it is reverting is that LuCI reverts the changes if it cannot connect to the browser after a time out period (particularly relevant when you are changing base level network settings). And why is it doing that? Well, you're trying to change the physical port that your computer is currently plugged into... so it is likely working (temporarily) but then being reverted back because this breaks connectivity with your computer. This is a safety mechanism to prevent people from locking themselves out of the router accidentally (you can override that with the "apply unchecked" option,]). The simple solution is this: plug your computer into one of the other LAN ports and then try to make the change. It should work properly.

@psherman @mk24 thanks a lot. but before I do this, since I locked myself out before, can you please confirm that the changes I made make sense, that they are done as Mike had suggested, please?
And here's what I will then do;
connect the port that I configured, in this case port 1 in VLAN 2 to the switch with Internet connection.
Then connect my computer to any of the other ports on VLAN 2.
Can you please confirm?
Thanks a lot.

Confirmed.

  • Computer connected to any of the other ethernet ports LAN2-4 (Note: the numbering in the interface may or may not be consistent with the physical numbering on the plastic case of the router)
  • Port LAN1: tagged on the CPU, becomes untagged on VLAN2, off on VLAN1.
  • Network Interface: wan on eth0.2, DHCP client, associated with the wan firewall zone.
  • Port LAN1 now becomes your WAN port -- connect that to your upstream device and you should get an IP address and hopefully be connected to the internet.

@psherman And you Peter, are a genius. Here's evidence of your great work. Thanks also to Mike.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.