2013/12/18 Rafał Miłecki <[email protected]>:
> Some routers (a lot of/all Broadcom's BCM47xx based models) have only
> a one network card attached to a switch. In such situation you usually
> use one VLAN for WAN port and another VLAN for LAN ports.
>
> The problem is that WAN is a virtual VLAN interface and it's always
> up. Even if I disconnect ethernet cable from the WAN, eth0.X is still
> up.
>
> Do you have any idea how this could be improved?
> Could we for example keep a list of VLANs with only one port assigned
> and adjust VLAN interface state to match current port state? Is this
> the right thing to do?
> How otherwise we can know that WAN is disconnected/not working?

Or maybe you have some other idea how we can handle refreshing IP
address on VLAN interface? Currently once-assigned IP doesn't change
until I restart network manually.



##### State after booting with WAN disconnected #####

root@OpenWrt:/# swconfig dev eth0 show | grep port
        ports: 0x011f
        link: port:0 link:down
        link: port:1 link:down
        link: port:2 link:down
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:down
        link: port:6 link:down
        link: port:7 link:down
        link: port:8 link:up speed:1000baseT full-duplex
        ports: 1 2 3 4 8t
        ports: 0 8t
root@OpenWrt:/# ifconfig eth0.2
eth0.2    Link encap:Ethernet  HWaddr C8:3A:35:37:C1:88
          inet6 addr: fe80::ca3a:35ff:fe37:c188/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 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:0 (0.0 B)  TX bytes:5124 (5.0 KiB)



##### After connecting WAN to 100Mb/s router #####

root@OpenWrt:/# swconfig dev eth0 show | grep port
        ports: 0x011f
        link: port:0 link:up speed:100baseT full-duplex auto
        link: port:1 link:down
        link: port:2 link:down
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:down
        link: port:6 link:down
        link: port:7 link:down
        link: port:8 link:up speed:1000baseT full-duplex
        ports: 1 2 3 4 8t
        ports: 0 8t
root@OpenWrt:/# ifconfig eth0.2
eth0.2    Link encap:Ethernet  HWaddr C8:3A:35:37:C1:88
          inet addr:192.168.7.210  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::ca3a:35ff:fe37:c188/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5076 (4.9 KiB)  TX bytes:10546 (10.2 KiB)



##### After disconnecting WAN - please note IP is still set! #####

root@OpenWrt:/# swconfig dev eth0 show | grep port
        ports: 0x011f
        link: port:0 link:down
        link: port:1 link:down
        link: port:2 link:down
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:down
        link: port:6 link:down
        link: port:7 link:down
        link: port:8 link:up speed:1000baseT full-duplex
        ports: 1 2 3 4 8t
        ports: 0 8t
root@OpenWrt:/# ifconfig eth0.2
eth0.2    Link encap:Ethernet  HWaddr C8:3A:35:37:C1:88
          inet addr:192.168.7.210  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::ca3a:35ff:fe37:c188/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5152 (5.0 KiB)  TX bytes:10948 (10.6 KiB)



##### After connecting WAN to a different 1000Mb/s router - IP wasn't
renewed! #####

root@OpenWrt:/# swconfig dev eth0 show | grep port
        ports: 0x011f
        link: port:0 link:up speed:1000baseT full-duplex auto
        link: port:1 link:down
        link: port:2 link:down
        link: port:3 link:down
        link: port:4 link:down
        link: port:5 link:down
        link: port:6 link:down
        link: port:7 link:down
        link: port:8 link:up speed:1000baseT full-duplex
        ports: 1 2 3 4 8t
        ports: 0 8t
root@OpenWrt:/# ifconfig eth0.2
eth0.2    Link encap:Ethernet  HWaddr C8:3A:35:37:C1:88
          inet addr:192.168.7.210  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::ca3a:35ff:fe37:c188/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5152 (5.0 KiB)  TX bytes:11434 (11.1 KiB)



root@OpenWrt:/# /etc/init.d/network restart
[  124.672000] br-lan: port 1(eth0.1) entered disabled state
[  124.684000] device eth0.1 left promiscuous mode
[  124.688000] device eth0 left promiscuous mode
[  124.692000] br-lan: port 1(eth0.1) entered disabled state
[  130.936000] device eth0.1 entered promiscuous mode
[  130.940000] device eth0 entered promiscuous mode
[  130.952000] br-lan: port 1(eth0.1) entered forwarding state
[  130.956000] br-lan: port 1(eth0.1) entered forwarding state
[  132.368000] libphy: bgmac-0-0:1e - Link is Up - 1000/Full
[  132.960000] br-lan: port 1(eth0.1) entered forwarding state



root@OpenWrt:/# ifconfig eth0.2
eth0.2    Link encap:Ethernet  HWaddr C8:3A:35:37:C1:88
          inet addr:192.168.3.210  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fdb6:b3e3:6faf:0:ca3a:35ff:fe37:c188/64 Scope:Global
          inet6 addr: fe80::ca3a:35ff:fe37:c188/64 Scope:Link
          inet6 addr: fdb6:b3e3:6faf::487/128 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1506 (1.4 KiB)  TX bytes:2658 (2.5 KiB)
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to