Temat: Routing miedzy podsieciami na kliku Vlan'ach

Witam!

Mam dwa vlany na WAN, tagowany(VLAN6) i nietagowany.
A. na VLAN6 mam podsieć 172.x.x.x (WAN_A ports = '0t 5t')
B. na drugim podsieć 213.x.x.x (WAN_B ports = '0 5t')

ruch z WAN_B mam w 'lan' (ports = '1 2 3 4 5t')
ruch z WAN_A też chcę mieć w 'lan'

Jak to zrobić ?

Jakiś routing ? czy może nowy interface i bridge ?

config 'interface' 'lan'
    option 'ifname' 'eth0.1'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.10.1'

#droga z wan_b ->lan ???
config route
    option interface wan_b
    option target 192.168.10.0
    option 'netmask' '255.255.255.0'
    option gateway 192.168.10.1

#droga z lan -> wan_b ???
config route
    option interface lan
    option target 172.18.188.0
    option 'netmask' '255.255.254.0'
    option gateway 172.18.188.1

Czy jakoś inaczej ?
Nie bardzo wiem o co chodzi z tym routingiem i działam po omacku, proszę o podpowiedz.
Pozdrawiam!

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

2

Odp: Routing miedzy podsieciami na kliku Vlan'ach

Kurcze zero odpowiedzi, chyba jakieś wydufany problem
tu postawiłem i nie da się tego tak zrobić.

TO może zapytam inaczej:

Mam dwie sieci z różnej adresacji i zależy mi na obu najlepiej poprzez NAT,
da sie to zrobić ? Jakiś muliwan ? czy routing ? jak to ugryźć ?
Czy może reguła na iptables wystarczy ?

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

3

Odp: Routing miedzy podsieciami na kliku Vlan'ach

tu żaden routing raczej nie potrzebny.
co to za sprzęt ?

generalnie na 1043nd zrobiłbym na porcie van w sekcji switch w /etc/config/network
przydział odpowiednich vlan
po tym dostaniemy dwa iface
z obu sobie pobierzesz adres dhcp np.

poczytaj sobie
http://rpc.one.pl/index.php/lista-artyk … od-openwrt
stare ale coś ci się tam rozjaśni


poza tym nie napisałeś co na obu podsieciach jest internet nic nie napisałeś.
jak tak to musisz użyć pakietu multiwan np.

4

Odp: Routing miedzy podsieciami na kliku Vlan'ach

rpc napisał/a:

tu żaden routing raczej nie potrzebny.
co to za sprzęt ?

generalnie na 1043nd zrobiłbym na porcie van w sekcji switch w /etc/config/network
przydział odpowiednich vlan
po tym dostaniemy dwa iface
z obu sobie pobierzesz adres dhcp np.

poczytaj sobie
http://rpc.one.pl/index.php/lista-artyk … od-openwrt
stare ale coś ci się tam rozjaśni

Dzięki za wskazówki,
właśnie na podstawie tego artykułu (swoją drogą bardzo dobrego)
zrobiłem wcześniej przykład 4.
Jednak tam (jak dobrze rozumiem i widzę na rysunku) eth0.6 z portem 4 jest poza NAT.
Zresztą zgodnie z tym co napisane w tym artykule,
cyt. "Mamy internet na komputerach i jednocześnie możemy oglądać telewizję
poprzez tuner IPTV STB podłączony bezpośrednio do portu 4 routera."

a mi chodzi o to aby to co na porcie 4, dać w NAT.

rpc napisał/a:

poza tym nie napisałeś co na obu podsieciach jest internet nic nie napisałeś.
jak tak to musisz użyć pakietu multiwan np.

Z obu podsieci dostawcy mam internet,
tzn. z jednej internet z drugiej iptv (ale to chyba nie ma znaczenia).

Oto moja działająca konfiguracja, w oparciu o przykład 4, z podesłanego linku.

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

config 'interface' 'lan'
    option 'ifname' 'eth0.1'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.10.1'

config 'interface' 'wan'
    option 'ifname' 'eth0.2'
    option 'proto' 'dhcp'

config 'interface' 'wan2'
    option 'ifname' 'eth0.400'
    option 'proto' 'dhcp'

config 'switch'
    option 'name' 'rtl8366rb'
    option 'reset' '1'
    option 'enable_vlan' '1'
    option 'enable_vlan4k' '1'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '1'
    option 'ports' '1 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '350'
    option 'ports' '0t 4t 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '400'
    option 'ports' '0t 2 3 4t 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '2'
    option 'ports' '0 4 5t'

config 'interface' 'vlan350'
    option 'ifname' 'eth0.350'
    option 'proto' 'dhcp'

Jednak do szczęścia brakuje przerzucenie tego co u mnie na porcie 2 i 3 do NAT.

Proszę o pomoc.
Pozdrawiam!

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

5

Odp: Routing miedzy podsieciami na kliku Vlan'ach

wrzuć jakiś prosty schemat co chcesz uzyskać z adresowaniem, vlan, i numerami portów

6

Odp: Routing miedzy podsieciami na kliku Vlan'ach

rpc napisał/a:

wrzuć jakiś prosty schemat co chcesz uzyskać z adresowaniem, vlan, i numerami portów

Ok, racja jeden obrazek to 1000 słów. Może to lepiej zobrazuje moją potrzebę, czyli to mam:

http://rpc.one.pl/images/stories/images/wr1043nd/vlan_wr1043nd_iptv_schemat.jpg

To chciałbym osiągnąć:

http://i.imgur.com/JWxkg.jpg

W tej chwili mogę podłączyć tylko jedną końcówkę do portu 4,
a chcę kilku klientów także przez WIFI.

Pozdrawiam!

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

7

Odp: Routing miedzy podsieciami na kliku Vlan'ach

po wifi ? niby jacy klienci komputery czy jakiś sprzętowy tuner IPTV będziesz podłączał ?

nat na 172.18.x.x raczej do zrobienia tylko po co Tobie to ? Internet będziesz ciągnął czy co ?

generalnie w słowach co chcesz podłączać i uzyskać

pokaż logi

ifconfig
route -n
cat /etc/config/network
cat /etc/config/firewall
cat /etc/firewall_user

8

Odp: Routing miedzy podsieciami na kliku Vlan'ach

rpc napisał/a:

po wifi ? niby jacy klienci komputery czy jakiś sprzętowy tuner IPTV będziesz podłączał ?
tylko po co Tobie to ? Internet będziesz ciągnął czy co ?
generalnie w słowach co chcesz podłączać i uzyskać

na końcówce port 4 (ten port nie musi być w NAT)
chcę podłączyć sprzętowy tuner IPTV, a na pozostałych kompy.

Ale pozostałe końcówki muszą być w NAT aby można wykorzystać pakiety 'igmpproxy' i 'udpxy'
(http://wiki.openwrt.org/doc/howto/udp_multicast)

Ogólnie wiem że to zadziała bo gdy na WAN dam nietagowany sygnał (ten który w przykładzie wychodzi z portu 4)
to po wifi (przez udpxy) i na portach (przez igmpproxy) wszystko hula że aż miło,
tylko nie mam wtedy internetu :-(((( bo go nie ma w tym VLANie.

rpc napisał/a:

pokaż logi

logi zacznę za chwilę wklejać w kolejnych postach

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

9

Odp: Routing miedzy podsieciami na kliku Vlan'ach

/etc/config/network

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

config 'interface' 'lan'
    option 'ifname' 'eth0.1'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.10.1'

config 'interface' 'wan'
    option 'ifname' 'eth0.2'
    option 'proto' 'dhcp'

config 'interface' 'wan2'
    option 'ifname' 'eth0.400'
    option 'proto' 'dhcp'

config 'switch'
    option 'name' 'rtl8366rb'
    option 'reset' '1'
    option 'enable_vlan' '1'
    option 'enable_vlan4k' '1'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '1'
    option 'ports' '1 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '350'
    option 'ports' '0t 4t 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '400'
    option 'ports' '0t 2 3 4t 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '2'
    option 'ports' '0 4 5t'

config 'interface' 'vlan350'
    option 'ifname' 'eth0.350'
    option 'proto' 'dhcp'
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

10

Odp: Routing miedzy podsieciami na kliku Vlan'ach

cat /etc/config/firewall

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

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

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

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-DHCPv6'
        option 'src' 'wan'
        option 'proto' 'udp'
        option 'src_ip' 'fe80::/10'
        option 'src_port' '547'
        option 'dest_ip' 'fe80::/10'
        option 'dest_port' '546'
        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' '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'
        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' '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 'include'
        option 'path' '/etc/firewall.user'

# ----- to poniżej dodałem na potrzeby udpxy
config 'rule'
       option 'src' 'wan'
       option 'proto' 'igmp'
       option 'target' 'ACCEPT'

config 'rule'
       option 'src' 'wan'
       option 'proto' 'udp'
       option 'dest_ip' '224.0.0.0/4'
       option 'target' 'ACCEPT'
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

11

Odp: Routing miedzy podsieciami na kliku Vlan'ach

root@OpenWrt:~# cat /etc/firewall_user
cat: can't open '/etc/firewall_user': No such file or directory
root@OpenWrt:~# vi /etc/firewall.user
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

12

Odp: Routing miedzy podsieciami na kliku Vlan'ach

cat /etc/firewall.user

13

Odp: Routing miedzy podsieciami na kliku Vlan'ach

rpc napisał/a:

cat /etc/firewall.user

Jest powyżej, ale wklejam jeszcze raz

root@OpenWrt:~# vi /etc/firewall.user
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

14 (edytowany przez rpc 2012-03-28 20:36:45)

Odp: Routing miedzy podsieciami na kliku Vlan'ach

do /etc/config/firewall dodaj

config 'zone'
        option 'name' 'vlan350'
        option 'input' 'REJECT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'
        option 'masq' '1'
        option 'network' 'vlan350'

config 'forwarding'
        option 'src' 'lan'
        option 'dest' 'vlan350'

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

config 'rule'
        option 'name' 'Allow-Ping-vlan350'
        option 'src' 'vlan350'
        option 'proto' 'icmp'
        option 'icmp_type' 'echo-request'
        option 'family' 'ipv4'
        option 'target' 'ACCEPT'

Do pliku /etc/config/dhcp o ile jeszcze nie masz takiego wpisu dodaj

config dhcp vlan350
        option interface        vlan350
        option ignore   1

dobrze by było zwrócić uwagę aby nie było dwóch tras domyślnych w routingu
nie podałeś logu z
route -n

15

Odp: Routing miedzy podsieciami na kliku Vlan'ach

route -n

213.154.24.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0.2
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 br-lan
172.14.18.0    0.0.0.0         255.255.254.0   U     0      0        0 eth0.400
172.18.15.0     0.0.0.0         255.255.252.0   U     0      0        0 eth0.350
0.0.0.0         172.14.18.1    0.0.0.0         UG    0      0        0 eth0.400
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

16

Odp: Routing miedzy podsieciami na kliku Vlan'ach

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          inet addr:192.168.10.1  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:403 errors:0 dropped:0 overruns:0 frame:0
          TX packets:89 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:34313 (33.5 KiB)  TX bytes:11524 (11.2 KiB)

eth0      Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:933 errors:0 dropped:0 overruns:92754 frame:0
          TX packets:415 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:86968 (84.9 KiB)  TX bytes:45900 (44.8 KiB)
          Interrupt:4

eth0.1    Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:341 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:33982 (33.1 KiB)

eth0.2    Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          inet addr:213.154.24.43  Bcast:213.154.24.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:536 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:32666 (31.9 KiB)  TX bytes:2085 (2.0 KiB)

eth0.350 Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          inet addr:172.18.15.29  Bcast:172.18.15.255  Mask:255.255.252.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1549 (1.5 KiB)  TX bytes:1636 (1.5 KiB)

eth0.400 Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          inet addr:172.14.18.165  Bcast:172.14.18.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:330 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:37029 (36.1 KiB)  TX bytes:6748 (6.5 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3426 (3.3 KiB)  TX bytes:3426 (3.3 KiB)

mon.wlan0 Link encap:UNSPEC  HWaddr 54-E6-FC-1C-41-C4-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6274 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:1206595 (1.1 MiB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 54:E6:FC:1C:41:C4
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:406 errors:0 dropped:0 overruns:0 frame:0
          TX packets:421 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:40279 (39.3 KiB)  TX bytes:50998 (49.8 KiB)
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

17

Odp: Routing miedzy podsieciami na kliku Vlan'ach

no i co wprowadziłeś zmiany już ? masz tego nata ?

18

Odp: Routing miedzy podsieciami na kliku Vlan'ach

rpc napisał/a:

no i co wprowadziłeś zmiany już ? masz tego nata ?

Wprowadziłem sugerowane zmiany. Dwa razy sprawdziłem.
Nadal nie działa.

Mam taki efekt jak pinguje z routera lub klienta Windows:
- lan 192.168.10.1,
- lan 192.168.10.105 końcówka na której siedzę z Windows
- vlan350 172.18.15.1
- vlan400 172.14.18.1
- wan 213.154.24.1

to odpowiadają mi pingi tylko z lan i wan

Jak podłączę się z klienta Windows bezpośrednio pod port 2 lub 3
wówczas jestem w podsieci 172.18.15.x
i odpowiadają mi pingi.

Próbowałem też:

config dhcp 'vlan350'
        option 'interface' 'vlan350'
        option 'ignore' '1'

Zamiast

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

bo miałem już wpis

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

i bałem że się gryzie,
ale to nic nie zmieniło.

Co jeszcze mam sprawdzić ? co ustawić ?

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

19

Odp: Routing miedzy podsieciami na kliku Vlan'ach

Dziwne jest to że klient na porcie 2 i 3
może pingować sieć 172.18.15.x
a z routera nie mogę jej pingować.

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

20 (edytowany przez rpc 2012-03-28 20:39:58)

Odp: Routing miedzy podsieciami na kliku Vlan'ach

maja być oba wpisy a w sumie to trzy bo jeszcze dla vlan400

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

config dhcp 'vlan350'
        option 'interface' 'vlan350'
        option 'ignore' '1'

config dhcp 'vlan400'
        option 'interface' 'vlan400'
        option 'ignore' '1'

one tylko mówią aby na tych interfejsach nie nasłuchiwać dhcp

no bo nie tak masz plik network jak chcesz na rysunku . Nie sprawdzałem go bo pisałeś że jest ok.

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

config 'interface' 'lan'
    option 'ifname' 'eth0.1'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.10.1'

config 'interface' 'wan'
    option 'ifname' 'eth0.2'
    option 'proto' 'dhcp'

config 'interface' 'vlan350'
    option 'ifname' 'eth0.350'
    option 'proto' 'dhcp'
    option 'gateway' '0.0.0.0'

config 'interface' 'vlan400'
    option 'ifname' 'eth0.400'
    option 'proto' 'dhcp'
    option 'gateway' '0.0.0.0'

config 'switch'
    option 'name' 'rtl8366rb'
    option 'reset' '1'
    option 'enable_vlan' '1'
    option 'enable_vlan4k' '1'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '1'
    option 'ports' '1 2 3 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '2'
    option 'ports' '0 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '350'
    option 'ports' '0t 4t 5t'

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '400'
    option 'ports' '0t 5t'

a więc tak
po zmianach w /etc/config/network powinieneś mieć
lan -> porty 1,2,3 nietagowane - dostep do internetu poprzez NAT i port wan
wan -> port 0 nietagowany - dostep do internetu
vlan350 -> porty 0,4 tagowane - dostep do iptv
vlan400 -> port 0 tagowany - dostep tylko z routera

w sumie to nie jestem pewny czy na porcie 4 wymagasz tagowania czy nie dla STB IPTV. Jesli nie to popraw sekcje jak niżej

config 'switch_vlan'
    option 'device' 'rtl8366rb'
    option 'vlan' '350'
    option 'ports' '0t 4 5t'

jak dobrze ustawi swconfig to powinieneś uzyskać takie zmiany jak wyżej
do tego te zmiany w firewallu dla vlan350

pokaż logi z ustawienia tych vlan

swconfig dev rtl8366rb vlan 1 show
swconfig dev rtl8366rb vlan 2 show
swconfig dev rtl8366rb vlan 350 show
swconfig dev rtl8366rb vlan 400 show

pokaż jeszcze

route -n
iptables -L -v
iptables -t nat -L -v

ps.odezwe sie wieczorem

21

Odp: Routing miedzy podsieciami na kliku Vlan'ach

rpc napisał/a:

no bo nie tak masz plik network jak chcesz na rysunku . Nie sprawdzałem go bo pisałeś że jest ok.

Ok, faktycznie miałem troszkę inaczej, ale zamysł był zachowany.
(w tej poprzedniej konfiguracji na port 4 dawałem wszystko co mam na WAN
a na port 2,3 nietagowany vlan350, a na port 1 tylko lan, jednym słowem
to co na rysunku było portem 4 u mnie było portem 2 i 3 a na 4 miałem wszystko to co na WAN).

Ale nie ważne, żeby już nie mieszać zrobiłem dokładnie tak jak napisałeś.
Dodałem także wpisy w dhcp dla vlan400.
Bez zmian, ifconfig taki sam. pingi tak samo się zachowują.
W kolejnych postach wklejam to o co prosiłeś.

TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

22 (edytowany przez alossek 2012-03-28 21:21:00)

Odp: Routing miedzy podsieciami na kliku Vlan'ach

swconfig'i :

root@OpenWrt:~# swconfig dev rtl8366rb vlan 1 show
VLAN 1:
        info: VLAN 1: Ports: '1235t', members=002e, untag=000e, fid=0
        fid: 0
        ports: 1 2 3 5t
root@OpenWrt:~# swconfig dev rtl8366rb vlan 2 show
VLAN 2:
        info: VLAN 2: Ports: '05t', members=0021, untag=0001, fid=0
        fid: 0
        ports: 0 5t
root@OpenWrt:~# swconfig dev rtl8366rb vlan 400 show
VLAN 400:
        info: VLAN 400: Ports: '0t5t', members=0021, untag=0000, fid=0
        fid: 0
        ports: 0t 5t
root@OpenWrt:~# swconfig dev rtl8366rb vlan 350 show
VLAN 350:
        info: VLAN 350: Ports: '0t45t', members=0031, untag=0010, fid=0
        fid: 0
        ports: 0t 4 5t
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

23

Odp: Routing miedzy podsieciami na kliku Vlan'ach

root@OpenWrt:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 br-lan
172.18.15.0     0.0.0.0         255.255.254.0   U     0      0        0 eth0.350
172.14.18.0     0.0.0.0         255.255.252.0   U     0      0        0 eth0.400
0.0.0.0         172.18.15.1     0.0.0.0         UG    0      0        0 eth0.350
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

24

Odp: Routing miedzy podsieciami na kliku Vlan'ach

Chain INPUT (policy ACCEPT 35 packets, 7092 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    any     anywhere             anywhere            state INVALID 
  633 70318 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED 
    8   544 ACCEPT     all  --  lo     any     anywhere             anywhere            
    4   208 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN 
  663 79895 input_rule  all  --  any    any     anywhere             anywhere            
  663 79895 input      all  --  any    any     anywhere             anywhere            

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    any     anywhere             anywhere            state INVALID 
  126 50315 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED 
  444 94265 forwarding_rule  all  --  any    any     anywhere             anywhere            
  444 94265 forward    all  --  any    any     anywhere             anywhere            
  190 62320 reject     all  --  any    any     anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    any     anywhere             anywhere            state INVALID 
  927  169K ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED 
    8   544 ACCEPT     all  --  any    lo      anywhere             anywhere            
  365 28807 output_rule  all  --  any    any     anywhere             anywhere            
  365 28807 output     all  --  any    any     anywhere             anywhere            

Chain forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
   23  2004 zone_lan_forward  all  --  br-lan any     anywhere             anywhere            
    0     0 zone_vlan350_forward  all  --  eth0.350 any     anywhere             anywhere            

Chain forwarding_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  444 94265 nat_reflection_fwd  all  --  any    any     anywhere             anywhere            

Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_vlan350 (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    5   654 zone_lan   all  --  br-lan any     anywhere             anywhere            
    9   252 zone_vlan350  all  --  eth0.350 any     anywhere             anywhere            

Chain input_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_vlan350 (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain nat_reflection_fwd (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain output (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  365 28807 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere            
  361 27485 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere            
  136 10286 zone_vlan350_ACCEPT  all  --  any    any     anywhere             anywhere            

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain reject (5 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset 
  258 70437 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable 

Chain syn_flood (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    4   208 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50 
    0     0 DROP       all  --  any    any     anywhere             anywhere            

Chain zone_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  491 42151 input_lan  all  --  any    any     anywhere             anywhere            
  491 42151 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere            

Chain zone_lan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  any    br-lan  anywhere             anywhere            
    5   654 ACCEPT     all  --  br-lan any     anywhere             anywhere            

Chain zone_lan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    br-lan  anywhere             anywhere            
    0     0 DROP       all  --  br-lan any     anywhere             anywhere            

Chain zone_lan_REJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all  --  any    br-lan  anywhere             anywhere            
    0     0 reject     all  --  br-lan any     anywhere             anywhere            

Chain zone_lan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  254 31945 zone_vlan350_ACCEPT  all  --  any    any     anywhere             anywhere            
  231 29941 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere            
    0     0 forwarding_lan  all  --  any    any     anywhere             anywhere            
    0     0 zone_lan_REJECT  all  --  any    any     anywhere             anywhere            

Chain zone_wan (0 references)
 pkts bytes target     prot opt in     out     source               destination         
   68 22388 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc 
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request 
   44  7445 input_wan  all  --  any    any     anywhere             anywhere            
   44  7445 zone_wan_REJECT  all  --  any    any     anywhere             anywhere            

Chain zone_wan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_wan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_wan_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_wan_forward (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 forwarding_wan  all  --  any    any     anywhere             anywhere            
    0     0 zone_wan_REJECT  all  --  any    any     anywhere             anywhere            

Chain zone_vlan350 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc 
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request 
   24   672 input_vlan350  all  --  any    any     anywhere             anywhere            
   24   672 zone_vlan350_REJECT  all  --  any    any     anywhere             anywhere            

Chain zone_vlan350_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
  155 11986 ACCEPT     all  --  any    eth0.350  anywhere             anywhere            
    0     0 ACCEPT     all  --  eth0.350 any     anywhere             anywhere            

Chain zone_vlan350_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    eth0.350  anywhere             anywhere            
    0     0 DROP       all  --  eth0.350 any     anywhere             anywhere            

Chain zone_vlan350_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all  --  any    eth0.350  anywhere             anywhere            
    9   252 reject     all  --  eth0.350 any     anywhere             anywhere            

Chain zone_vlan350_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 forwarding_vlan350  all  --  any    any     anywhere             anywhere            
    0     0 zone_vlan350_REJECT  all  --  any    any     anywhere             anywhere            
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)

25 (edytowany przez alossek 2012-03-28 18:14:02)

Odp: Routing miedzy podsieciami na kliku Vlan'ach

Chain PREROUTING (policy ACCEPT 122 packets, 21677 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  967  147K prerouting_rule  all  --  any    any     anywhere             anywhere            
   16  1761 zone_lan_prerouting  all  --  br-lan any     anywhere             anywhere            
   10   280 zone_vlan350_prerouting  all  --  eth0.350 any     anywhere             anywhere            

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  515 46672 postrouting_rule  all  --  any    any     anywhere             anywhere            
    0     0 zone_lan_nat  all  --  any    br-lan  anywhere             anywhere            
  147 11393 zone_vlan350_nat  all  --  any    eth0.350  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 136 packets, 10286 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain nat_reflection_in (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain nat_reflection_out (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  515 46672 nat_reflection_out  all  --  any    any     anywhere             anywhere            

Chain prerouting_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  961  146K nat_reflection_in  all  --  any    any     anywhere             anywhere            

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain prerouting_vlan350 (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_lan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  260 49864 prerouting_lan  all  --  any    any     anywhere             anywhere            

Chain zone_vlan350_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  147 11393 MASQUERADE  all  --  any    any     anywhere             anywhere            

Chain zone_vlan350_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  439 42389 prerouting_vlan350  all  --  any    any     anywhere             anywhere            

Chain zone_wan_nat (0 references)
 pkts bytes target     prot opt in     out     source               destination         
  353 33437 MASQUERADE  all  --  any    any     anywhere             anywhere            

Chain zone_wan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination         
  155 31587 prerouting_wan  all  --  any    any     anywhere             anywhere
TP-Link TL-WDR4300 v1, Reboot (17.01-SNAPSHOT, r3876-efb6ca1)