1 (edytowany przez matrixmm 2013-02-09 16:32:15)

Temat: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Jak w temacie, potrzebuję pomocy.
Siedzę od 3 dni i 3 nocy, ćwiczę, zmieniam, resetuje i nijak nie potrafię skonfigurować VLAN tak by np na portach switha 1 i 2 była sieć 192.168.1.1 a na 3,4 sieć 192.168.2.1 i aby obie były na DHCP i by były od siebie odseparowane. W najlepszym wypadku doszedłem do konfiguracji że na każdym porcie mogę podłączyć komp ze stałym IP i pinga na obie sieci lan 192.168.1. i 192.168.2. Jednak wtedy nie działa DHCP i jest wszystko to samo na każdym porcie. Czytałem forum i różne inne temat na o Open WRT i nic mi to nie dało Konfigurowałem jak w artykule z eko.one.pl WN1043ND i też nic. Próbowałem konfigurować przez interfejs Luci i też dupa. Zazwyczaj po restarcie w ogóle nic nie działa i trzeba robić fail safe start.
Może ktoś ma więcej doświadczenia i podzieli się nim ze mną.
Będę wdzięczny za każdą pomoc.

2

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Pokaż zawartość /etc/config/network, dhcp, firewall z tym co dotychczas zrobiłeś.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Teraz mam już po tysięcznym restarcie, więc może być bez sensu smile Próbowałem już w ciemno metodą prób i błędów.

/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 proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option _orig_ifname 'eth0'
    option _orig_bridge 'false'
    option ifname 'eth0'

config interface 'wan'
    option ifname 'eth1'
    option proto 'dhcp'

config switch 'eth0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'eth0'
    option vlan '1'
    option ports '0 1 2 3'
    option vid '1'

config interface 'vlan11'
    option proto 'static'
    option ipaddr '192.168.11.1'
    option netmask '255.255.255.0'
    option type 'bridge'
    option _orig_ifname 'eth0.11'
    option _orig_bridge 'true'
    option ifname 'eth0.11'

config switch_vlan
    option device 'eth0'
    option vlan '11'
    option ports '4'
    option vid '11'

/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.auto'

config dhcp 'lan'
    option interface 'lan'
    option start '100'
    option limit '150'
    option leasetime '12h'

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

config dhcp
    option start '100'
    option leasetime '12h'
    option limit '150'
    option interface 'vlan11'


/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
    option network        'lan'
    option input        ACCEPT
    option output        ACCEPT
    option forward        REJECT

config zone
    option name        wan
    option network        '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

# 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

# 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        fe80::/10
    option src_port        547
    option dest_ip        fe80::/10
    option dest_port    546
    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

# 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    00:11:22:33:44:66
#    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

# allow IPsec/ESP and ISAKMP passthrough
#config rule
#    option src        wan
#    option dest        lan
#    option protocol        esp
#    option target        ACCEPT

#config rule
#    option src        wan
#    option dest        lan
#    option src_port        500
#    option dest_port    500
#    option proto        udp
#    option target        ACCEPT

### FULL CONFIG SECTIONS
#config rule
#    option src        lan
#    option src_ip    192.168.45.2
#    option src_mac    00:11:22:33:44:55
#    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    00:11:22:33:44:55
#    option src_port        1024
#    option src_dport    80
#    option dest_ip    194.25.2.129
#    option dest_port    120
#    option proto    tcp

4

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Zrób swconfig dev switch0 help

Brak Ci sekcji lan2 , brak ci sekcji w dhcp, inaczej lekko trzeba switch zdefiniować (ale to jak pokażesz wynik w/w polecenia).

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Próbowałem wcześniej lan2  teraz mi zostało lan11 czy to jest jakaś różnica?
A w dhcp jakiej sekcji brak?
Próbowałem dhcp ustawiać także przez LuCi i też na nic twórczego nie wpadłem.

/etc/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 proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option _orig_ifname 'eth0'
    option _orig_bridge 'false'
    option ifname 'eth0'

config interface 'wan'
    option ifname 'eth1'
    option proto 'dhcp'

config switch 'eth0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'eth0'
    option vlan '1'
    option ports '0 1 2 3'
    option vid '1'

config interface 'vlan11'
    option proto 'static'
    option ipaddr '192.168.11.1'
    option netmask '255.255.255.0'
    option _orig_ifname 'eth0.11'
    option _orig_bridge 'true'
    option ifname 'eth0.11'

config switch_vlan
    option device 'eth0'
    option vlan '11'
    option ports '4'
    option vid '11'

config interface 'lan2'
    option proto 'static'
    option ifname 'eth0.11'
    option ipaddr '192.168.2.1'
    option netmask '255.255.255.0'



/etc/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.auto'

config dhcp 'lan'
    option interface 'lan'
    option start '100'
    option limit '150'
    option leasetime '12h'

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

config dhcp
    option start '100'
    option leasetime '12h'
    option limit '150'
    option interface 'vlan11'

config dhcp 'lan2'
    option start '100'
    option leasetime '12h'
    option limit '150'
    option interface 'lan2'

6

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Akurat vlan11 masz a nie lan2. Pokaż wynik tego polecenia.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Pogubiłem się...
No teraz mam inerfejsy: Lan, Lan2, Vlan11 i Wan

root@OpenWrt:~# swconfig dev switch0 help
switch0: eth0(AR7240/AR9330 built-in switch), ports: 5 (cpu @ 0), vlans: 16
     --switch
        Attribute 1 (int): enable_vlan (Enable VLAN mode)
        Attribute 2 (none): apply (Activate changes in the hardware)
        Attribute 3 (none): reset (Reset the switch)
     --vlan
        Attribute 1 (int): vid (VLAN ID)
        Attribute 2 (ports): ports (VLAN port mapping)
     --port
        Attribute 1 (int): pvid (Primary VLAN ID)
        Attribute 2 (string): link (Get port link information)
root@OpenWrt:~#

8

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

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 proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ifname 'eth0.1'
config interface 'lan2'
    option proto 'static'
    option ipaddr '192.168.2.1'
    option netmask '255.255.255.0'
    option ifname 'eth0.2'
config interface 'wan'
    option ifname 'eth1'
    option proto 'dhcp'
config switch 'eth0'
    option reset '1'
    option enable_vlan '1'
config switch_vlan
    option device 'eth0'
    option vlan '1'
    option ports '0t 1 2'
    option vid '1'
config switch_vlan
    option device 'eth0'
    option vlan '2'
    option ports '0t 3 4'
    option vid '1'


z dhcp to możesz usunać:
config dhcp
    option start '100'
    option leasetime '12h'
    option limit '150'
    option interface 'vlan11'

W firewallu w zalezności jak chcesz - musisz dodać podobnie jak dla lan - zone dla lan2 i zezwolić na forwarding lan2 <> wan.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Zrobiłem tak jak napisałeś. /etc/config/network j.w.
Z dhcp wywaliłem vlan11
Dodałem zonę do firewalla i po restarcie nie mogę się dostać do routera. Jedynie telnet w failsafe mode.
Właśnie w tym miejscu staję. Tak jak napisałeś powyżej /etc/config/network już miałem.
Nie mogę się dostać do routera. Dopiero jak zmienię:
config interface 'lan'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ifname 'eth0'     # a nie eth0.1    to mogę ponownie wejść do routera po lan.

10 (edytowany przez matrixmm 2013-02-09 19:38:32)

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Dodam jeszcze, że do puki nie zmienię eth0.1 na eth0 router nie przydziela dhcp na żadnym porcie. jak ustawię w kompie stały ip 192..168.1.2 to też nie pinga do czasu zmiany przez telnet na eth0

11

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Uruchom więc w failsafe, zrób mount_root i pokaż wynik polecenia

uci show network

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

12

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Usuń też   option vid '1' z obu lanów.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

13

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan.ifname=eth0.1
network.lan2=interface
network.lan2.proto=static
network.lan2.ipaddr=192.168.2.1
network.lan2.netmask=255.255.255.0
network.lan2.ifname=eth0.2
network.wan=interface
network.wan.ifname=eth1
network.wan.proto=dhcp
network.eth0=switch
network.eth0.reset=1
network.eth0.enable_vlan=1
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device=eth0
network.@switch_vlan[0].vlan=1
network.@switch_vlan[0].ports=0t 1 2
network.@switch_vlan[0].vid=1
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device=eth0
network.@switch_vlan[1].vlan=2
network.@switch_vlan[1].ports=0t 3 4
network.@switch_vlan[1].vid=1

14

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

a czy vid w obydwu VLAN'ach powinien być 1 ?

15 (edytowany przez snifer 2013-02-10 00:20:54)

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

No właśnie nie powinno być takie samo, dla vlan 2 ustaw vid=2 albo jak pisał Cezary obydwie opcje vid wywal całkiem.
W Twoim pierwszym konfigu nie działało bo nie dałeś dołożonego vlana na port 0 (cpu).

Archer C7 v.2 + LEDE by Cezary http://beta.speedtest.net/pl/result/6621599402

16 (edytowany przez matrixmm 2013-02-10 10:52:41)

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

ok po zmianie lub wywaleniu vid jestem znowu w miejscu w którym już byłem. A mionowicie.

Router przydziel na każdym porcie dhcp z zakresu" 192.168.1.1/24. Mogę pingać na każdym porcie zarówno na 192.168.1.1 jak i na 192.168.2.1. Jak zmienię z ręki IP kompa na 192.168.2.1 to nie mogę pingać na żadnym porcie ani na 192.168.1.1 ani na 192.168.2.1.

17

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

uci show network
uci show dhcp
uci show firewall
swconfig dev switch0 show

Znów pokaż.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

18

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

root@OpenWrt:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan.ifname=eth0.1
network.lan2=interface
network.lan2.proto=static
network.lan2.ipaddr=192.168.2.1
network.lan2.netmask=255.255.255.0
network.lan2.ifname=eth0.2
network.wan=interface
network.wan.ifname=eth1
network.wan.proto=dhcp
network.eth0=switch
network.eth0.reset=1
network.eth0.enable_vlan=1
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device=eth0
network.@switch_vlan[0].vlan=1
network.@switch_vlan[0].ports=0t 1 2
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device=eth0
network.@switch_vlan[1].vlan=2
network.@switch_vlan[1].ports=0t 3 4


dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded=1
dhcp.@dnsmasq[0].boguspriv=1
dhcp.@dnsmasq[0].filterwin2k=0
dhcp.@dnsmasq[0].localise_queries=1
dhcp.@dnsmasq[0].rebind_protection=1
dhcp.@dnsmasq[0].rebind_localhost=1
dhcp.@dnsmasq[0].local=/lan/
dhcp.@dnsmasq[0].domain=lan
dhcp.@dnsmasq[0].expandhosts=1
dhcp.@dnsmasq[0].nonegcache=0
dhcp.@dnsmasq[0].authoritative=1
dhcp.@dnsmasq[0].readethers=1
dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
dhcp.lan=dhcp
dhcp.lan.interface=lan
dhcp.lan.start=100
dhcp.lan.limit=150
dhcp.lan.leasetime=12h
dhcp.wan=dhcp
dhcp.wan.interface=wan
dhcp.wan.ignore=1
dhcp.lan2=dhcp
dhcp.lan2.start=100
dhcp.lan2.leasetime=12h
dhcp.lan2.limit=150
dhcp.lan2.interface=lan2

root@OpenWrt:~# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=lan
firewall.@zone[0].input=ACCEPT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=REJECT
firewall.@zone[0].network=
firewall.@zone[1]=zone
firewall.@zone[1].name=wan
firewall.@zone[1].network=wan
firewall.@zone[1].input=REJECT
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].masq=1
firewall.@zone[1].mtu_fix=1
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src=lan
firewall.@forwarding[0].dest=wan
firewall.@rule[0]=rule
firewall.@rule[0].name=Allow-DHCP-Renew
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].name=Allow-Ping
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=ACCEPT
firewall.@rule[2]=rule
firewall.@rule[2].name=Allow-DHCPv6
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].name=Allow-ICMPv6-Input
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
firewall.@rule[3].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type router-solicitation neighbour-solicitation router-advertisement neighbour-advertisement
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].name=Allow-ICMPv6-Forward
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
firewall.@zone[2]=zone
firewall.@zone[2].name=newzone
firewall.@zone[2].network=
firewall.@zone[2].input=REJECT
firewall.@zone[2].output=REJECT
firewall.@zone[2].forward=REJECT
firewall.@zone[3]=zone
firewall.@zone[3].name=newzone2
firewall.@zone[3].input=ACCEPT
firewall.@zone[3].forward=REJECT
firewall.@zone[3].output=ACCEPT
firewall.@zone[3].network=lan vlan11
firewall.@zone[4]=zone
firewall.@zone[4].name=newzone3
firewall.@zone[4].network=
firewall.@zone[5]=zone
firewall.@zone[5].name=newzone4
firewall.@zone[5].network=
firewall.@zone[6]=zone
firewall.@zone[6].name=newzone5
firewall.@zone[6].network=
firewall.@zone[7]=zone
firewall.@zone[7].name=newzone6
firewall.@zone[7].input=ACCEPT
firewall.@zone[7].forward=REJECT
firewall.@zone[7].output=ACCEPT
firewall.@zone[7].network=lan2
firewall.@forwarding[1]=forwarding
firewall.@forwarding[1].dest=wan
firewall.@forwarding[1].src=newzone6
firewall.@zone[8]=zone
firewall.@zone[8].name=vlan1
firewall.@zone[8].network=vlan1
firewall.@zone[8].input=ACCEPT
firewall.@zone[8].output=ACCEPT
firewall.@zone[8].forward=REJECT
firewall.@zone[9]=zone
firewall.@zone[9].name=vlan2
firewall.@zone[9].network=vlan2
firewall.@zone[9].input=ACCEPT
firewall.@zone[9].output=ACCEPT
firewall.@zone[9].forward=REJECT

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
Port 0:
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        pvid: 1
        link: port:1 link:down
Port 2:
        pvid: 1
        link: port:2 link:up speed:100baseT full-duplex auto
Port 3:
        pvid: 2
        link: port:3 link:down
Port 4:
        pvid: 2
        link: port:4 link:down
VLAN 0:
        vid: 0
        ports: 0t
VLAN 1:
        vid: 1
        ports: 0t 1 2
VLAN 2:
        vid: 2
        ports: 0t 3 4

19

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Identyczna konfiguracja zrobiona przed chwilą: port 1/2 w jednej i 3/4 w drugiej sieci. Działa tak jak trzeba - na portach 3/4 nie można ani pingować ani dostać się do 192.168.1.1, nadaje z dhcp adres z adresu 192.168.2.x.

root@Gargoyle:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.ifname=eth0.1
network.lan.type=bridge
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan2=interface
network.lan2.ifname=eth0.2
network.lan2.type=bridge
network.lan2.proto=static
network.lan2.ipaddr=192.168.2.1
network.lan2.netmask=255.255.255.0
network.@switch[0]=switch
network.@switch[0].name=eth0
network.@switch[0].reset=1
network.@switch[0].enable_vlan=1
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device=eth0
network.@switch_vlan[0].vlan=1
network.@switch_vlan[0].ports=0t 1 2
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device=eth0
network.@switch_vlan[1].vlan=2
network.@switch_vlan[1].ports=0t 3 4
network.wan=interface
network.wan.proto=dhcp
network.wan.ifname=wwan0
network.wan.auto=0
root@Gargoyle:~# uci show dhcp
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded=1
dhcp.@dnsmasq[0].boguspriv=1
dhcp.@dnsmasq[0].filterwin2k=0
dhcp.@dnsmasq[0].localise_queries=1
dhcp.@dnsmasq[0].rebind_protection=1
dhcp.@dnsmasq[0].rebind_localhost=1
dhcp.@dnsmasq[0].local=/lan/
dhcp.@dnsmasq[0].domain=lan
dhcp.@dnsmasq[0].expandhosts=1
dhcp.@dnsmasq[0].nonegcache=0
dhcp.@dnsmasq[0].authoritative=1
dhcp.@dnsmasq[0].readethers=1
dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
dhcp.lan=dhcp
dhcp.lan.interface=lan
dhcp.lan.start=100
dhcp.lan.limit=150
dhcp.lan.leasetime=12h
dhcp.lan2=dhcp
dhcp.lan2.interface=lan2
dhcp.lan2.start=100
dhcp.lan2.limit=150
dhcp.lan2.leasetime=12h
dhcp.wan=dhcp
dhcp.wan.interface=wan
dhcp.wan.ignore=1
root@Gargoyle:~# swconfig dev switch0 show
Global attributes:
    enable_vlan: 1
Port 0:
    pvid: 0
    link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
    pvid: 1
    link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
    pvid: 1
    link: port:2 link:down
Port 3:
    pvid: 2
    link: port:3 link:down
Port 4:
    pvid: 2
    link: port:4 link:down
VLAN 0:
    vid: 0
    ports: 0t 
VLAN 1:
    vid: 1
    ports: 0t 1 2 
VLAN 2:
    vid: 2
    ports: 0t 3 4 
Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

20

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Zrobiłem trochę porządku w firewall bo straszny tam był śmietnik po moich wszystkich zmianach. Ale też to nic nie zmieniło sad

root@OpenWrt:~# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=wan
firewall.@zone[0].network=wan
firewall.@zone[0].input=REJECT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=REJECT
firewall.@zone[0].masq=1
firewall.@zone[0].mtu_fix=1
firewall.@rule[0]=rule
firewall.@rule[0].name=Allow-DHCP-Renew
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].name=Allow-Ping
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=ACCEPT
firewall.@rule[2]=rule
firewall.@rule[2].name=Allow-DHCPv6
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].name=Allow-ICMPv6-Input
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
firewall.@rule[3].icmp_type=echo-request echo-reply destination-unreachable pack
et-too-big time-exceeded bad-header unknown-header-type router-solicitation neig
hbour-solicitation router-advertisement neighbour-advertisement
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].name=Allow-ICMPv6-Forward
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable pack
et-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
firewall.@zone[1]=zone
firewall.@zone[1].name=vlan1
firewall.@zone[1].input=ACCEPT
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].network=lan
firewall.@zone[2]=zone
firewall.@zone[2].name=vlan2
firewall.@zone[2].input=ACCEPT
firewall.@zone[2].output=ACCEPT
firewall.@zone[2].forward=REJECT
firewall.@zone[2].network=lan2
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].dest=wan
firewall.@forwarding[0].src=vlan2
firewall.@forwarding[1]=forwarding
firewall.@forwarding[1].dest=wan
firewall.@forwarding[1].src=vlan1

21

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

jeszcze raz.
Zrobiłem dokładnie taki sam config.

root@OpenWrt:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.ifname=eth0.1
network.lan.type=bridge
network.lan.proto=static
network.lan.ipaddr=192.168.1.1
network.lan.netmask=255.255.255.0
network.lan2=interface
network.lan2.ifname=eth0.2
network.lan2.type=bridge
network.lan2.proto=static
network.lan2.ipaddr=192.168.2.1
network.lan2.netmask=255.255.255.0
network.@switch[0]=switch
network.@switch[0].name=eth0
network.@switch[0].reset=1
network.@switch[0].enable_vlan=1
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device=eth0
network.@switch_vlan[0].vlan=1
network.@switch_vlan[0].ports=0t 1 2
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device=eth0
network.@switch_vlan[1].vlan=2
network.@switch_vlan[1].ports=0t 3 4
network.wan=interface
network.wan.ifname=eth1
network.wan.proto=dhcp

root@OpenWrt:~# uci show dhcp
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded=1
dhcp.@dnsmasq[0].boguspriv=1
dhcp.@dnsmasq[0].filterwin2k=0
dhcp.@dnsmasq[0].localise_queries=1
dhcp.@dnsmasq[0].rebind_protection=1
dhcp.@dnsmasq[0].rebind_localhost=1
dhcp.@dnsmasq[0].local=/lan/
dhcp.@dnsmasq[0].domain=lan
dhcp.@dnsmasq[0].expandhosts=1
dhcp.@dnsmasq[0].nonegcache=0
dhcp.@dnsmasq[0].authoritative=1
dhcp.@dnsmasq[0].readethers=1
dhcp.@dnsmasq[0].leasefile=/tmp/dhcp.leases
dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
dhcp.lan=dhcp
dhcp.lan.interface=lan
dhcp.lan.start=100
dhcp.lan.limit=150
dhcp.lan.leasetime=12h
dhcp.wan=dhcp
dhcp.wan.interface=wan
dhcp.wan.ignore=1
dhcp.lan2=dhcp
dhcp.lan2.start=100
dhcp.lan2.leasetime=12h
dhcp.lan2.limit=150
dhcp.lan2.interface=lan2

root@OpenWrt:~# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=wan
firewall.@zone[0].network=wan
firewall.@zone[0].input=REJECT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=REJECT
firewall.@zone[0].masq=1
firewall.@zone[0].mtu_fix=1
firewall.@rule[0]=rule
firewall.@rule[0].name=Allow-DHCP-Renew
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].name=Allow-Ping
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=ACCEPT
firewall.@rule[2]=rule
firewall.@rule[2].name=Allow-DHCPv6
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].name=Allow-ICMPv6-Input
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
firewall.@rule[3].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type router-solicitation neighbour-solicitation router-advertisement neighbour-advertisement
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].name=Allow-ICMPv6-Forward
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
firewall.@zone[1]=zone
firewall.@zone[1].name=vlan1
firewall.@zone[1].input=ACCEPT
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].network=lan
firewall.@zone[2]=zone
firewall.@zone[2].name=vlan2
firewall.@zone[2].input=ACCEPT
firewall.@zone[2].output=ACCEPT
firewall.@zone[2].forward=REJECT
firewall.@zone[2].network=lan2
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].dest=wan
firewall.@forwarding[0].src=vlan2
firewall.@forwarding[1]=forwarding
firewall.@forwarding[1].dest=wan
firewall.@forwarding[1].src=vlan1

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
Port 0:
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        pvid: 1
        link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
        pvid: 1
        link: port:2 link:down
Port 3:
        pvid: 2
        link: port:3 link:down
Port 4:
        pvid: 2
        link: port:4 link:down
VLAN 0:
        vid: 0
        ports: 0t
VLAN 1:
        vid: 1
        ports: 0t 1 2
VLAN 2:
        vid: 2
        ports: 0t 3 4

I działa tak jak pisałem wcześniej. Przydziela adres z zakresu 192.168.1.x na każdym porcie i można pingać zarówno na 192.168.1.1 jak i na 192.168.2.1 na każdym porcie sad

Co mogę robić źle ? ;(

22 (edytowany przez matrixmm 2013-02-10 12:26:31)

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

update:

Na porcie LAN1 przydziela adres z zakresu 192.168.1.x a na portach L2, L3, L4 przydziela adres z zakresu 192.168.2.x

Z każdego portu można pingać zarówno na 192.168.1.1 jak i 192.168.2.1

A może porty są numerowany inaczej niż cyferki nabite na routerze? Rozumiem, że WAN ma numer 5. Pierwszy od strony WAN to 1 następne kolejno 2, 3 ,4.

23

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Trochę więcej wiem.
A więc porty na routerze opisane 1,2,3,4 w rzeczywistości są portami 2,3,4,1 wink nie wiem dlaczego tak. pozostaje kwestia odseparowania sieci 192.168.1.x od 192.168.2.x A może one są odseparowane tylko z obu można pingać na adresy 192.168.1.1 i 192.168.2.1 bo to adres switcha ale jak podepne kompa w inny port to już nie bęxzie można. Na ta chwile nie mam drugiego kompa by to sprawdzić.

24

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

Nie zawsze numeracja portów w switchu odpowiada tym fizycznym na obudowie.

Firewall trzeba było zostawić tak jak był, skopiować tylko to co jest dla lan i zmienić nazwy lan na lan2

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

25

Odp: TP-Link TL-WR740N v4.23 + VLAN'y Pomocy.

No ok. Teraz wygląda na to, że działa.
Znaczy jak podpinam pod odpowiednie porty to przydziela adresy jak trzeba. Podpiąłem drugi komputer i wygląda na to, że jest ok. Z komputera mogę pingać na oba adresy  routera 192.168.1.1 i 192.168.1.2.
Na inne nie pinga. Problem w tym, że nie pinguje też na adresy w tej samej sieci, czyli na drugi komputer w tej samej sieci vlan. Nie wiem czy to może jakaś blokada pinga czy może coś mam jeszcze w firewalu ustawić.