Help with OpenWrt network configuration

Hello

I am new here and new in OpenWrt.
I need your help with setting up 2 routers with Openwrt.

My problem is next.... I have ISP xDSL modem with 4 ports, 2 ports for Internet and 2 for IPTV
Need to sett both routers VLANs so I can pass both internet and iptv thru 1 cable to the upper floor in house. There is no option for adding more cables.

I know how to set VLANs and thats it.

Does someone have nerves to help me with it.

Best regards

To help, we need more info.

  • A system diagram should be the starting point. Please include all network infrastructure equipment along with their model numbers and network addresses.
  • Is your DSL modem acting as the router for the network?
  • Are you planing to use the OpenWrt devices as routers? VLAN-aware switches? dumb APs?
  • What hardware are you using for your OpenWrt devices?
  • Have you already flashed OpenWrt onto your devices?

Adresses needed to be passed thru all, as ISP sends them
I am planing to use Asus as router for WLAN.

As I have seen in ISP modem/router VLANS for Internet are 200 and 300 for IPTV
Both Asus and TP Link have latest OpenWrt.

Also, it would be nice if I have access to both routers via Luci when i am on WIFI or cable after Asus.

Best regards

Will the modem be running in bridge mode and not acting as a router for your internet connection? If so, you'll setup the WR1043ND with VLAN200 and include your DSL connection credentials in on that device. If the ISP's modem will be running as a router, you'll setup your WR1043ND as a dumb AP (and then later deal with the VLANs.)

The RT-N16 should be setup as a dumb AP. This will make it just a standard AP and you'll be able to access both OpenWrt devices from anywhere on the network.

I'd recommend starting with the RT-N16 dumb AP configuration first. Once that is working, we can address the WR1043ND (based on your answers from above) and get VLANs working.

Problem is that at ISP modem/router have 4 ports, 2 for internet, 2 for IPTV.
Down floor need both internet and IPTV.

I just need to "combine" IPTV and internet via 1 UTP cable to upper floor, and separate them on Asus. I can't touch ISP modem, they reset them occasionally. only WIFI on them are not touched (TR069)

Address that I get for IPTV is 10.XXX.XXX.XXX.

And another thing... I want to learn that just to understand functionality.

I managed to combine them, but i have flood. And cant get both them to work.
Is there a way to transfer all that modem/router sends, i mean addresses and all of it.

We'll get there.

Do not connect the IPTV connection yet.

Start with your RT-N16 - configure it as a dumb AP.

I have done that. Without WIFI. Just putted fix IP on laptop.

I don't understand. What specifically did you do? And what does the laptop have to do with the OpenWrt configurations?

I have configured RT-N16 as dumbAP
Putted fix IP so i can access it. I'm working disconnected from both routers. :smiley:
Have to. I'm configuring routers with my laptop

For the RT-N16, you should be able to connect it to your main router (using the LAN ports on both devices).

Let's see the following files from your routers (be sure to make it clear which one comes from each 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/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Please one step backwards. I'm totally new in here.
I'm on windows, I have reseted both OpenWrt routers, putted N16 as dumbAP, dissabled DHCP.
How can I get this output from Luci.

Sorry if I am boring you, but still learning

You can't. You need to use ssh to connect to the router so you can use the command line interface.
If you don't have it already, download and install putty or a similar program that can do ssh.

Is this OK
 OpenWrt 21.02.1, r16325-88151b8303
 -----------------------------------------------------
root@OpenWrt:~# 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 'fde2:a671:e12f::/48'

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

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

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 8t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 2 3 4 8t'

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'bcm47xx_soc/bcma0:1'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

root@OpenWrt:~# 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'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        option ignore '1'

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

root@OpenWrt:~# cat /etc/config/firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

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

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

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

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'

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'

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'

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'

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'

config include
        option path '/etc/firewall.user'

root@OpenWrt:~#

type or paste code here

Ok... so this looks good for the RT-N16.

You need to figure out which physical port is handling the uplink (to the other router). The labeling on the case doesn't always correspond to the ports as listed in the config files. You also need to decide which port will be used to connect the IPTV box to the RT-N16.

In the web interface, take a look at Network > Switch -- take a screenshot and post that here.

I speeded up a little,
Hope this is OK

Which device is this from? Is it the RT-N16?

If so: Figure out which physical port is being used as the uplink (i.e. from the WR1043ND). Unplug that cable from the RT-N16 and you will see which of those reports "no link" -- presumably that will be LAN1 or LAN2. Please tell me which one that is. And note the relationship between what you see on the screen vs the physical case markings (usually it is either 1=1, 2=2, etc. or reversed 1=4, 2=3, etc.).

Then, decide which physical port you want to use for the IPTV box -- LAN2-4 or WAN.

I want to use uplink for both iptv and internet on wan
As it is just as other ports, as i know
iptv is on LAN2, Internet is on LAN4

Do you mean you want to use the WAN port of the RT-N16 as the physical uplink port?

Maybe I should clarify my question.

  • You will have an uplink port -- this is the port on the back of the RT-N16 that connects to the cable that runs down to your WR1043ND. I need to know which physical port on the RT-N16 you want to use for this purpose. Tell me which port (1-4 or WAN) you want to use here.
  • You will have one or more ports that are used to connect your IPTV boxes to the RT-N16. I need to know which physical port(s) (on the RT-N16) you plan to use for this purpose. Tell me which port(s) (1-4) will be used for this.
  • The rest of the port(s) will theoretically just be for wired computers, right?

Usually, the mapping of the physical WAN port is fairly straight forward -- the switch page usually matches what is on the physical case markings. But this is not always true for the LAN1 - LAN4 port numbering from the switch page to the physical case numbers. To find out which how they are mapped, usually you can plug something into either port 1 or port 4 (as marked on the back of the device) and look at which port shows a link on the switch page. Then unplug that device and verify that that port now says "no link". Usually this will either be port 1 <-> LAN 1, or port 1 <-> LAN 4.

First you need a sound foundation where they are both working as dumb APs. A dumb AP has only one network, the LAN, and the DHCP server is disabled on that network. The APs are connected by an Ethernet cable which is initially one of the default lan ports, carrying only untagged packets in the lan.

Once that is working then you can proceed.

Since both of these are swconfig kernels, except for one problem, to make the IPTV VLAN work you don't need to change any configuration other than the switch.

The problem here is that in the TP-Link the default lan VLAN is 1 and in the Asus it is 2. In the default configuration this is not an issue since all the ports are untagged, and the internal VLAN numbers are removed before the packets go to any external device. But for a VLAN trunk cable to work, the switches at both ends need to be tagging packets with the same VLAN number. So you need to rearrange the networking in one box to use a compatible number. This means changing the physical port of the lan from eth0.1 to eth0.2, and also reconfiguring the switch so that VLAN 2 is the lan ports. You can just delete the wan and wan6 networks you're not using so there is no need for VLAN 2 for anything else. Then have both eth0.1 and eth0.2 in the lan network for now until you complete the migration to vlan 2.

Once the lan is running on the same VLAN number in both routers, go ahead and change the cable that connects the routers together to be tagged on both ends. They should still be connected.

Then you can add another VLAN for TV. This can have any number you want as long as its not already in use and it is the same on both ends. Numbers less than 16 are recommended as some switch hardware needs special configuration to handle higher numbers. Make the TV VLAN tagged on the trunk cable and untagged on the port that you're going to connect to the modem (or TV box on the other router). Remove this untagged port from all other VLANs.

Note that you don't have to connect the TV VLAN to the CPU port since the CPU need not be handling TV packets. They will be hardware switched directly in the switch chip.

I agree with @mk24 's statements here, but I want to start with the far end (i.e. the RT-N16) and work back. The OP has not yet clarified if the WR1043ND is being used as an AP or a router, but I figure we'll get there once the N16 is set correctly.