How to connect VLANs to internet?

Does your openwrt lan work?

yes work normally and I can access to internet from it

any suggestions brothers !!!

Try this:

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '6t'
        option vid '2'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0 5 6t'
        option vid '3'


config interface 'vlan3'
        option proto 'static'
        option device 'eth0.3'
        option netmask '255.255.255.0'
        option broadcast '192.168.110.255'
        option ipaddr '192.168.110.33'

and in the firewall:

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

config forwarding
        option src 'vlan3'
        option dest 'lan'

config forwarding
        option src 'lan'
        option dest 'vlan3'

config forwarding
        option src 'vlan3'
        option dest 'wan'

It gives me that my laptop connected to internet and there is a network, but when I ping internet or use google the result is I can't access to internet.

Could you try explaining that again... it is a bit confusing. Your laptop is connected to the internet? But then it doesn't work? What does that mean, specifically?

res

When I plug my laptop to vlan 3 the above sign appear which mean it connected to network but when I use google or ping internet there is no internet or I can't access internet in other word.

Note: In lan I can access to internet normally.

What do you get for the network information on the laptop when you connect to vlan3?

Also, what are the first two octets of the wan ip on your openwrt router? (aaa.bbb.ccc.ddd)

My laptop give me ip normal and there is no error .
How to see wan ip ?

1

I don’t see dns being provided.

From the laptop, what happens if you ping 8.8.8.8?

For the wan ip of OpenWrt, you can look at the web interface main status page - it will have a section for IPv4 upstream.

This is the result :face_with_open_eyes_and_hand_over_mouth:
1

Brother i don't know where I should go:
2

How about this:

Ssh into the router and provide the output of this:

ifconfig

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr E8:94:F6:0F:54:B2
          inet addr:192.168.100.240  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fd58:841:d787::1/60 Scope:Global
          inet6 addr: fe80::ea94:f6ff:fe0f:54b2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2719 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2705 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:423907 (413.9 KiB)  TX bytes:1131102 (1.0 MiB)

eth0      Link encap:Ethernet  HWaddr E8:94:F6:0F:54:B2
          inet6 addr: fe80::ea94:f6ff:fe0f:54b2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3531 errors:0 dropped:2 overruns:0 frame:0
          TX packets:2898 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:577455 (563.9 KiB)  TX bytes:1178551 (1.1 MiB)

eth0.1    Link encap:Ethernet  HWaddr E8:94:F6:0F:54:B2
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2725 errors:0 dropped:6 overruns:0 frame:0
          TX packets:2705 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:424183 (414.2 KiB)  TX bytes:1131102 (1.0 MiB)

eth0.3    Link encap:Ethernet  HWaddr E8:94:F6:0F:54:B2
          inet addr:192.168.110.33  Bcast:192.168.110.255  Mask:255.255.255.0
          inet6 addr: fe80::ea94:f6ff:fe0f:54b2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:780 errors:0 dropped:9 overruns:0 frame:0
          TX packets:177 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:59444 (58.0 KiB)  TX bytes:18267 (17.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:830 errors:0 dropped:0 overruns:0 frame:0
          TX packets:830 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:74434 (72.6 KiB)  TX bytes:74434 (72.6 KiB)

I'm not seeing your WAN in the output there.

The IPv4 upstream can be seen in the main status page like this (bottom):

this appeared brother.

Is that the whole page?

This is the whole page.




Tell you what, I think it might make sense to reset the router to defaults (take a backup first -- you can restore that backup if necessary later).

This would also be a good time to upgrade to 21.02.2.

Once upgraded and in a default state, setup your dsl and wifi and make sure that works. Then post your fresh config files and we'll try again to get the VLAN to work properly.

2 Likes

I will follow your advice brother.

Thank you so much brother.

First, I return back to use vlan 2 then I add this role in port forward:

When I added it I can ping google.com and 1.1.1.1 from my laptop cmd as below:
1

But, when I want to use my browser this message appeared:

Any suggestions to solve this problem ?