×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

I am using SuSE Linux with desktop PC (PC2) eth0.5 is vlan ID 5

#vconfig add eth0 5
Added VLAN with VID == 5 to IF -:eth0:-
# ifconfig eth0.5 192.168.154.22 netmask 255.255.255.0 up
# ping 192.168.154.111

# cat /proc/net/vlan/eth0.5
eth0.5 VID: 5 REORDER_HDR: 1 dev->priv_flags: 1
total frames received 0
total bytes received 0
Broadcast/Multicast Rcvd 0

total frames transmitted 22
total bytes transmitted 4776
total headroom inc 0
total encap on xmit 0
Device: eth0
INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0
EGRESS priority mappings:
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / 请教网络问题关于VLAN。从192.168.154.11 PING 192.168.154.2的不同结果,PC1和PC2在同一SWITCH的LAN端口2,3和4。PC2 Linux kernel 2.6.28.3 PC1 freescale M54455EVB uClinux 2.6.23.
    本文发表在 rolia.net 枫下论坛PC1:
    eth0 Link encap:Ethernet HWaddr 00:04:9F:00:81:A9
    inet addr:10.0.0.109 Bcast:10.255.255.255 Mask:255.0.0.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:23842 errors:12 dropped:0 overruns:0 frame:12
    TX packets:294 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1793608 (1.7 Mb) TX bytes:17960 (17.5 Kb)

    eth0.5 Link encap:Ethernet HWaddr 00:04:9F:00:81:A9
    inet addr:192.168.154.11 Bcast:192.168.154.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:29 errors:0 dropped:0 overruns:0 frame:0
    TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:2682 (2.6 Kb) TX bytes:3602 (3.5 Kb)

    eth1 Link encap:Ethernet HWaddr 00:04:9F:00:81:AA
    inet addr:10.0.0.112 Bcast:10.255.255.255 Mask:255.0.0.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:16906 errors:13 dropped:0 overruns:0 frame:13
    TX packets:170 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1269704 (1.2 Mb) TX bytes:8452 (8.2 Kb)
    Base address:0x4000

    PC2:
    eth0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:10.0.0.108 Bcast:10.255.255.255 Mask:255.0.0.0
    inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    RX packets:898399 errors:0 dropped:0 overruns:0 frame:0
    TX packets:430032 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:262169242 (250.0 Mb) TX bytes:376485011 (359.0 Mb)
    Interrupt:252 Base address:0x8000

    eth0.5 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:192.168.154.22 Bcast:192.168.153.255 Mask:255.255.255.0
    inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:19 errors:0 dropped:0 overruns:0 frame:0
    TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1586 (1.5 Kb) TX bytes:10871 (10.6 Kb)

    eth0:0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:192.168.154.2 Bcast:192.168.154.255 Mask:255.255.255.0
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    Interrupt:252 Base address:0x8000

    eth0:1 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    Interrupt:252 Base address:0x8000

    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:16436 Metric:1
    RX packets:6531 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6531 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:547752 (534.9 Kb) TX bytes:547752 (534.9 Kb)
    以上配置时从PC1 PING PC2 正常
    / # ping 192.168.154.2
    PING 192.168.154.2 (192.168.154.2): 56 data bytes
    84 bytes from 192.168.154.2: icmp_seq=0 ttl=64 time=10.0 ms
    84 bytes from 192.168.154.2: icmp_seq=1 ttl=64 time=0.0 ms
    84 bytes from 192.168.154.2: icmp_seq=2 ttl=64 time=0.0 ms
    84 bytes from 192.168.154.2: icmp_seq=3 ttl=64 time=0.0 ms
    84 bytes from 192.168.154.2: icmp_seq=4 ttl=64 time=0.0 ms
    84 bytes from 192.168.154.2: icmp_seq=5 ttl=64 time=0.0 ms
    PC1 配置不变,改变PC2 VLAN ID 5 的配置 。
    #ifconfig eth0.5 192.168.153.22
    # ifconfig
    eth0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:10.0.0.108 Bcast:10.255.255.255 Mask:255.0.0.0
    inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    RX packets:898399 errors:0 dropped:0 overruns:0 frame:0
    TX packets:430032 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:262169242 (250.0 Mb) TX bytes:376485011 (359.0 Mb)
    Interrupt:252 Base address:0x8000

    eth0.5 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:192.168.153.22 Bcast:192.168.153.255 Mask:255.255.255.0
    inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:19 errors:0 dropped:0 overruns:0 frame:0
    TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1586 (1.5 Kb) TX bytes:10871 (10.6 Kb)

    eth0:0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:192.168.154.2 Bcast:192.168.154.255 Mask:255.255.255.0
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    Interrupt:252 Base address:0x8000

    eth0:1 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
    inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
    Interrupt:252 Base address:0x8000

    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:16436 Metric:1
    RX packets:6531 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6531 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:547752 (534.9 Kb) TX bytes:547752 (534.9 Kb)

    再从PC1 PING PC2 为什么没有回应?
    / # ping 192.168.154.2
    PING 192.168.154.2 (192.168.154.2): 56 data bytes

    --- 192.168.154.2 ping statistics ---
    10 packets transmitted, 0 packets received, 100% packet loss更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • inet addr:192.168.154.22 Bcast:192.168.(153).255 Mask:255.255.255.0?
    • 不懂你用的两套系统,略懂vlan,能不能简单说一下拓扑。
      • Linux 可以给同一个网卡设置多个IP地址。ifconfig输出的inet addr就是IP地址,Bcast是BROADCAST。 PC1的VLAN ID 5 的IP地址192.168.154.11和PC2的eth0:0 192.168.154.2在同一SUBNET,为什么改变PC2的VLAN ID 5 的设置
        (192.168.154.22 /192.168.154.255/255.255.255.0-> 192.168.153.22/192.168.153.255/255.255.255.0)导致192.168.154.11PING192.168.154.2不通?
        • look inside
          Looks that I need to study some Linux.

          As I do not know these Ops, I am not sure based on the info you provided.

          But something I can not understand:

          1, from the configuration, your port E0.5 encapsulate Ethernet, not 802.1Q, I do not think this is VLAN 5, just the sub-interface;
          2, Can I assume that the E0 and E0:0 are separate NICs in your PC2? If I can, from the TCP/IP perspective, I do not know why they can be configured in the same subnet. Maybe it is allowed in Linux?

          Other concerns about this case:
          1, if all of these three ports in the switch are in the same VLAN?
          2, if your PC2’s Eth0 enabled ARP PROXY?

          All of my thoughts are based on TCP/IP, I do not know anything about Linux.

          If you are interested in talking it deeply, please send me your msn.
      • service iptables restart, service network restart, 这两个试过没?这是redhat的命令,根据你用的linux变形一下吧。
    • 没看出哪点和VLAN有关呀。所有接口包装都是encap:Ethernet
      • Ah, Redhat VLAN shows all encap:Ethernet. MTU 1496. 看你全是1500不像跟用VLAN有关系的样子
      • I am using SuSE Linux with desktop PC (PC2) eth0.5 is vlan ID 5
        #vconfig add eth0 5
        Added VLAN with VID == 5 to IF -:eth0:-
        # ifconfig eth0.5 192.168.154.22 netmask 255.255.255.0 up
        # ping 192.168.154.111

        # cat /proc/net/vlan/eth0.5
        eth0.5 VID: 5 REORDER_HDR: 1 dev->priv_flags: 1
        total frames received 0
        total bytes received 0
        Broadcast/Multicast Rcvd 0

        total frames transmitted 22
        total bytes transmitted 4776
        total headroom inc 0
        total encap on xmit 0
        Device: eth0
        INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0
        EGRESS priority mappings:
        • Then it does make sense. VLAN5 no longer at the same network.
          • but I have eth0:0 with IP 192.168.154.2 at same network as VLAN5 of PC1.
            • It is not at the same VLAN
    • 不懂操作系统也不太懂网络,看得稀里糊涂。能说说你的switch那几个口及其VLAN是怎么配的吗?layer 3 的interface在哪里呀? 两台PC间不同VLAN通过什么互访呀?
      如果PC1的 VLAN5的 interface 只能和PC2 的VLAN5的 interface "直接" 通话; 如果PC1的 VLAN5的 interface 和PC2 的VLAN0的 interface 的通话要经过PC2 的VLAN5的 interface, 你的问题就好理解一些了.