LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2023, 11:12 AM   #1
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Rep: Reputation: 2
Smile Vlan port ping PC's IP well, but PC can't ping IP of vlan port


There are two network interfaces on board, eth0 and eth1. Eth0 is connected with a PHY chip directly, and eth1 is connected with a switch chip to expand 5 ports.

Here is 3 different vlans, eth1.10 have port 0 in vlan10, eth1.20 have port 1 and port 2 in vlan20, eth1.30 have port 3 and port 4 in vlan30.

eth0 --- interface

ech1 -- port 0 in Vlan10
-- port 1 in Vlan20
-- port 2 in Vlan20
-- port 3 in Vlan30
-- port 4 in Vlan30

The question is, why eth1.10(IP:192.168.8.162) can ping PC's IP(192.168.8.139) well, but PC can't ping eht1.10's IP.
Linux kernel version is 4.19, and the switch chip is working good, and arping both are good.

I have read the following thread but it doesn't work. https://www.linuxquestions.org/quest...0/#post4033474,


Tcpdump data:
//[FAIL]=====================================================================
Fail to ping eth1.10 from PC
【PC tcpdump data】
#
# ping -I eth0 192.168.8.162
PING 192.168.8.162 (192.168.8.162): 56 data bytes
11:12:15.213807 IP (tos 0x0, ttl 64, id 56617, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo request, id 492, seq 0, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0800 4500
0x0010: 0054 dd29 4000 4001 cb01 c0a8 088b c0a8
0x0020: 08a2 0800 3f29 01ec 0000 5fdc 570e 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000
11:12:16.214712 IP (tos 0x0, ttl 64, id 56683, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo request, id 492, seq 1, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0800 4500
0x0010: 0054 dd6b 4000 4001 cabf c0a8 088b c0a8
0x0020: 08a2 0800 efe1 01ec 0001 9f22 670e 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000

--- 192.168.8.162 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
11:12:20.232690 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.8.162 tell 192.168.8.139, length 28
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0806 0001
0x0010: 0800 0604 0001 9884 e3a8 a5ec c0a8 088b
0x0020: 0000 0000 0000 c0a8 08a2
11:12:20.233182 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.8.162 is-at 78:04:73:55:d5:30 (oui Unknown), length 46
0x0000: 9884 e3a8 a5ec 7804 7355 d530 0806 0001
0x0010: 0800 0604 0002 7804 7355 d530 c0a8 08a2
0x0020: 9884 e3a8 a5ec c0a8 088b 0000 0000 0000
0x0030: 0000 0000 0000 0000 0000 0000


【eth1.10 tcpdump data】
11:12:14.916330 IP (tos 0x0, ttl 64, id 56617, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo request, id 492, seq 0, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0800 4500 0054 dd29 4000 4001 cb01 c0a8
0x0020: 088b c0a8 08a2 0800 3f29 01ec 0000 5fdc
0x0030: 570e 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000
11:12:15.917230 IP (tos 0x0, ttl 64, id 56683, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo request, id 492, seq 1, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0800 4500 0054 dd6b 4000 4001 cabf c0a8
0x0020: 088b c0a8 08a2 0800 efe1 01ec 0001 9f22
0x0030: 670e 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000
11:12:19.935212 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.8.162 tell 192.168.8.139, length 50
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0806 0001 0800 0604 0001 9884 e3a8 a5ec
0x0020: c0a8 088b 0000 0000 0000 c0a8 08a2 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000
11:12:19.935416 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.8.162 is-at 78:04:73:55:d5:30 (oui Unknown), length 28
0x0000: 9884 e3a8 a5ec 7804 7355 d530 8100 000a
0x0010: 0806 0001 0800 0604 0002 7804 7355 d530
0x0020: c0a8 08a2 9884 e3a8 a5ec c0a8 088b




//[GOOD]=====================================================================
Good to ping PC from eth1.10
【eth1.10 tcpdump data】
# ping -I eth1.10 192.168.8.139
PING 192.168.8.139 (192.168.8.139): 56 data bytes
64 bytes from 192.168.8.139: seq=0 ttl=64 time=1.119 ms
11:15:03.057725 IP (tos 0x0, ttl 64, id 6986, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.162 > 192.168.8.139: ICMP echo request, id 516, seq 0, length 64
0x0000: 9884 e3a8 a5ec 7804 7355 d530 8100 000a
0x0010: 0800 4500 0054 1b4a 4000 4001 8ce1 c0a8
0x0020: 08a2 c0a8 088b 0800 c066 0204 0000 d87c
0x0030: 5d18 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000
11:15:03.058316 IP (tos 0x0, ttl 64, id 4239, offset 0, flags [none], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo reply, id 516, seq 0, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0800 4500 0054 108f 0000 4001 d79c c0a8
0x0020: 088b c0a8 08a2 0000 c866 0204 0000 d87c
0x0030: 5d18 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000
64 bytes from 192.168.8.139: seq=1 ttl=64 time=1.061 ms
11:15:04.058501 IP (tos 0x0, ttl 64, id 7040, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.162 > 192.168.8.139: ICMP echo request, id 516, seq 1, length 64
0x0000: 9884 e3a8 a5ec 7804 7355 d530 8100 000a
0x0010: 0800 4500 0054 1b80 4000 4001 8cab c0a8
0x0020: 08a2 c0a8 088b 0800 5b20 0204 0001 2ec2
0x0030: 6c18 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000
11:15:04.059052 IP (tos 0x0, ttl 64, id 4311, offset 0, flags [none], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo reply, id 516, seq 1, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0800 4500 0054 10d7 0000 4001 d754 c0a8
0x0020: 088b c0a8 08a2 0000 6320 0204 0001 2ec2
0x0030: 6c18 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000

--- 192.168.8.139 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.061/1.090/1.119 ms
11:15:08.094997 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.8.162 tell 192.168.8.139, length 50
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0806 0001 0800 0604 0001 9884 e3a8 a5ec
0x0020: c0a8 088b 0000 0000 0000 c0a8 08a2 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000
11:15:08.095166 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.8.162 is-at 78:04:73:55:d5:30 (oui Unknown), length 28
0x0000: 9884 e3a8 a5ec 7804 7355 d530 8100 000a
0x0010: 0806 0001 0800 0604 0002 7804 7355 d530
0x0020: c0a8 08a2 9884 e3a8 a5ec c0a8 088b
11:15:08.095817 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.8.139 tell 192.168.8.162, length 28
0x0000: 9884 e3a8 a5ec 7804 7355 d530 8100 000a
0x0010: 0806 0001 0800 0604 0001 7804 7355 d530
0x0020: c0a8 08a2 0000 0000 0000 c0a8 088b
11:15:08.096095 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.8.139 is-at 98:84:e3:a8:a5:ec (oui Unknown), length 50
0x0000: 7804 7355 d530 9884 e3a8 a5ec 8100 000a
0x0010: 0806 0001 0800 0604 0002 9884 e3a8 a5ec
0x0020: c0a8 088b 7804 7355 d530 c0a8 08a2 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000


【PC tcpdump data】
11:15:03.355724 IP (tos 0x0, ttl 64, id 6986, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.162 > 192.168.8.139: ICMP echo request, id 516, seq 0, length 64
0x0000: 9884 e3a8 a5ec 7804 7355 d530 0800 4500
0x0010: 0054 1b4a 4000 4001 8ce1 c0a8 08a2 c0a8
0x0020: 088b 0800 c066 0204 0000 d87c 5d18 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000
11:15:03.356018 IP (tos 0x0, ttl 64, id 4239, offset 0, flags [none], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo reply, id 516, seq 0, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0800 4500
0x0010: 0054 108f 0000 4001 d79c c0a8 088b c0a8
0x0020: 08a2 0000 c866 0204 0000 d87c 5d18 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000
11:15:04.356486 IP (tos 0x0, ttl 64, id 7040, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.8.162 > 192.168.8.139: ICMP echo request, id 516, seq 1, length 64
0x0000: 9884 e3a8 a5ec 7804 7355 d530 0800 4500
0x0010: 0054 1b80 4000 4001 8cab c0a8 08a2 c0a8
0x0020: 088b 0800 5b20 0204 0001 2ec2 6c18 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000
11:15:04.356759 IP (tos 0x0, ttl 64, id 4311, offset 0, flags [none], proto ICMP (1), length 84)
192.168.8.139 > 192.168.8.162: ICMP echo reply, id 516, seq 1, length 64
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0800 4500
0x0010: 0054 10d7 0000 4001 d754 c0a8 088b c0a8
0x0020: 08a2 0000 6320 0204 0001 2ec2 6c18 0000
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000
11:15:08.392684 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.8.162 tell 192.168.8.139, length 28
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0806 0001
0x0010: 0800 0604 0001 9884 e3a8 a5ec c0a8 088b
0x0020: 0000 0000 0000 c0a8 08a2
11:15:08.393104 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.8.162 is-at 78:04:73:55:d5:30 (oui Unknown), length 46
0x0000: 9884 e3a8 a5ec 7804 7355 d530 0806 0001
0x0010: 0800 0604 0002 7804 7355 d530 c0a8 08a2
0x0020: 9884 e3a8 a5ec c0a8 088b 0000 0000 0000
0x0030: 0000 0000 0000 0000 0000 0000
11:15:08.393733 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.8.139 tell 192.168.8.162, length 46
0x0000: 9884 e3a8 a5ec 7804 7355 d530 0806 0001
0x0010: 0800 0604 0001 7804 7355 d530 c0a8 08a2
0x0020: 0000 0000 0000 c0a8 088b 0000 0000 0000
0x0030: 0000 0000 0000 0000 0000 0000
11:15:08.393825 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.8.139 is-at 98:84:e3:a8:a5:ec (oui Unknown), length 28
0x0000: 7804 7355 d530 9884 e3a8 a5ec 0806 0001
0x0010: 0800 0604 0002 9884 e3a8 a5ec c0a8 088b
0x0020: 7804 7355 d530 c0a8 08a2
 
Old 02-23-2023, 11:26 AM   #2
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
This question bother me for a whole week, I hope there are someone can do me a favor, thank you.
 
Old 02-23-2023, 12:33 PM   #3
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 564

Rep: Reputation: Disabled
How did you configure these sub-interfaces?
Could you please post your config files and linux OS.
 
Old 02-23-2023, 06:34 PM   #4
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by yvesjv View Post
How did you configure these sub-interfaces?
Could you please post your config files and linux OS.
eth1.10 is a vlan on linux, configuring with shell command like these,
ip link add link eth1 name eth1.10 type vlan id 10
ifconfig eth1.10 192.168.8.162 netmask 255.255.255.0 up

# ifconfig
eth0 Link encap:Ethernet HWaddr 78:04:73:555:2E
inet addr:192.168.8.133 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::7a04:73ff:fe55:d52e/64 Scope:Link
inet6 addr: fd64:2315:f63:9500:7a04:73ff:fe55:d52e/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1138 (1.1 KiB) TX bytes:774 (774.0 B)
Interrupt:50

eth1 Link encap:Ethernet HWaddr 78:04:73:555:30
inet6 addr: fe80::7a04:73ff:fe55:d530/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1558 (1.5 KiB)

eth1.10 Link encap:Ethernet HWaddr 78:04:73:555:30
inet addr:192.168.8.162 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::7a04:73ff:fe55:d530/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:726 (726.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:140 (140.0 B) TX bytes:140 (140.0 B)
 
Old 02-24-2023, 01:39 PM   #5
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 564

Rep: Reputation: Disabled
Can you do a route command and what type of network switch did you connect both physical interfaces to?

Last edited by yvesjv; 02-24-2023 at 01:42 PM.
 
Old 02-24-2023, 07:33 PM   #6
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by yvesjv View Post
Can you do a route command and what type of network switch did you connect both physical interfaces to?
The route info show as following, and it's L2 switch. BTW, I connect the PC net port and switch's eth1.10 by a netting twine directly.
Code:
# route -e
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.8.0     *               255.255.255.0   U         0 0          0 eth0
192.168.8.0     *               255.255.255.0   U         0 0          0 eth1.10
192.168.8.0     *               255.255.255.0   U         0 0          0 eth1.20
192.168.8.0     *               255.255.255.0   U         0 0          0 eth1.30
# ip route
192.168.8.0/24 dev eth0 proto kernel scope link src 192.168.8.133
192.168.8.0/24 dev eth1.10 proto kernel scope link src 192.168.8.161
192.168.8.0/24 dev eth1.20 proto kernel scope link src 192.168.8.162
192.168.8.0/24 dev eth1.30 proto kernel scope link src 192.168.8.163

Last edited by Andy.liu; 02-24-2023 at 07:59 PM.
 
Old 02-25-2023, 03:07 AM   #7
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
I read the ICMP source code and debug, that found the vlan eth1.10 do receive echo ICMP request and ready to send back echo ICMP reply, but fail, then receive a wrong message, error TYPE=ICMP_DEST_UNREACH, CODE=ICMP_HOST_UNREACH. I just wonder if this error is result in VLAN configuration on linux or the relationship of eth1 and eth1.10. I'm not familiar with the SUBNET, particularly it's about VLAN.

The VLAN configuration commands show below,
Quote:

#switch vlan config
ip link add link eth1 name eth1.10 type vlan id 10
ip link set eth1.10 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
ip address add 192.168.8.161/24 dev eth1.10

ip link add link eth1 name eth1.20 type vlan id 20
ip link set eth1.20 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
ip address add 192.168.8.162/24 dev eth1.20

ip link add link eth1 name eth1.30 type vlan id 30
ip link set eth1.30 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
ip address add 192.168.8.163/24 dev eth1.30

#gateway config
ip route add default gw 192.168.8.1

ip link set eth1.10 up
ip link set eth1.20 up
ip link set eth1.30 up

Last edited by Andy.liu; 02-25-2023 at 03:11 AM.
 
Old 02-25-2023, 12:41 PM   #8
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 564

Rep: Reputation: Disabled
1. How are the trunks on the physical L2 switch configured and what manufacturer/model is it?
2. Can you verify on your linux machine the 802.1q module is loaded.
3. Your /24 could be subnetted in to individual /26, or change/assign your vlans subnets to .8/0/24, .9.0/24, .10.0/24 and so on.
 
Old 02-27-2023, 01:45 AM   #9
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by yvesjv View Post
1. How are the trunks on the physical L2 switch configured and what manufacturer/model is it?
2. Can you verify on your linux machine the 802.1q module is loaded.
3. Your /24 could be subnetted in to individual /26, or change/assign your vlans subnets to .8/0/24, .9.0/24, .10.0/24 and so on.
1.The L2 switch is Marvell MV88E6071 chip which is configured with VLAN based on 802.1Q. I think it's good 'cause we can see the 4 bytes TAG data inout from eth1.
2. 802.1q module is supported and built in kernel.
3.I try to change subnet to /26, it works. But maybe it's not a good idea, PC'IP not only ping eth1.10, but also eth1.20 and eth1.30, is't because I set eth1.10, eth1.20 and eth1.30 with the same netmask /26 ? When they(eth1.10, eth1.20 and eth1.30) are in different netmask that will be better, like 192.168.1.161/26, 192.168.2.162/26, 192.168.3.163/26.
Code:
# ifconfig
eth0      Link encap:Ethernet  HWaddr 98:84:E3:A8:A5:EC
          inet addr:192.168.8.139  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fe80::9a84:e3ff:fea8:a5ec/64 Scope:Link
          inet6 addr: fd64:2315:f63:9500:9a84:e3ff:fea8:a5ec/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3464 (3.3 KiB)  TX bytes:1882 (1.8 KiB)
          Interrupt:50

eth1      Link encap:Ethernet  HWaddr 98:84:E3:A8:A5:EE
          inet6 addr: fe80::9a84:e3ff:fea8:a5ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2350 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1180 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:180226 (176.0 KiB)  TX bytes:94976 (92.7 KiB)

eth1.10   Link encap:Ethernet  HWaddr 98:84:E3:A8:A5:EE
          inet addr:192.168.8.161  Bcast:0.0.0.0  Mask:255.255.255.192
          inet6 addr: fe80::9a84:e3ff:fea8:a5ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2338 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1119 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:127552 (124.5 KiB)  TX bytes:84686 (82.7 KiB)

eth1.20   Link encap:Ethernet  HWaddr 98:84:E3:A8:A5:EE
          inet addr:192.168.8.162  Bcast:0.0.0.0  Mask:255.255.255.192
          inet6 addr: fe80::9a84:e3ff:fea8:a5ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:974 (974.0 B)  TX bytes:1944 (1.8 KiB)

eth1.30   Link encap:Ethernet  HWaddr 98:84:E3:A8:A5:EE
          inet addr:192.168.8.163  Bcast:0.0.0.0  Mask:255.255.255.192
          inet6 addr: fe80::9a84:e3ff:fea8:a5ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1166 (1.1 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:25 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2716 (2.6 KiB)  TX bytes:2716 (2.6 KiB)

# route -ne
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.8.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.8.128   0.0.0.0         255.255.255.192 U         0 0          0 eth1.10
192.168.8.128   0.0.0.0         255.255.255.192 U         0 0          0 eth1.20
192.168.8.128   0.0.0.0         255.255.255.192 U         0 0          0 eth1.30
#
# ip route
192.168.8.0/24 dev eth0 proto kernel scope link src 192.168.8.139
192.168.8.128/26 dev eth1.10 proto kernel scope link src 192.168.8.161
192.168.8.128/26 dev eth1.20 proto kernel scope link src 192.168.8.162
192.168.8.128/26 dev eth1.30 proto kernel scope link src 192.168.8.163

Last edited by Andy.liu; 02-27-2023 at 01:47 AM.
 
Old 02-27-2023, 12:35 PM   #10
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 564

Rep: Reputation: Disabled
Not familiar with the Marvell MV88E6071, so cannot help you there. I'm interested though,where can I get my hands on one to play with?
Good news the 802.1q module is loaded.

Your subnetting is not helping.
Each vlan must be on it's own separate subnet with its own separate gateway.
For example if you've split your /24 into a /26:
vlan 1 can be from 192.168.1.0/26
vlan 2 can be from 192.168.1.64/26
vlan 3 can be from 192.168.1.128/26
vlan 4 can be from 192.168.1.192/26

They all talk via an L3 device that can be a switch, router, linux host with routing enabled, etc
It goes like this:
desktop/host <==(L2/access port on vlanX)==> L2 switch <==(dot1q trunk carrying vlans X/Y/Z)==> L3 device routing the vlans between each other and to the internet.

Last edited by yvesjv; 02-27-2023 at 12:37 PM.
 
Old 02-28-2023, 11:22 AM   #11
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by yvesjv View Post
Not familiar with the Marvell MV88E6071, so cannot help you there. I'm interested though,where can I get my hands on one to play with?
Good news the 802.1q module is loaded.

Your subnetting is not helping.
Each vlan must be on it's own separate subnet with its own separate gateway.
For example if you've split your /24 into a /26:
vlan 1 can be from 192.168.1.0/26
vlan 2 can be from 192.168.1.64/26
vlan 3 can be from 192.168.1.128/26
vlan 4 can be from 192.168.1.192/26

They all talk via an L3 device that can be a switch, router, linux host with routing enabled, etc
It goes like this:
desktop/host <==(L2/access port on vlanX)==> L2 switch <==(dot1q trunk carrying vlans X/Y/Z)==> L3 device routing the vlans between each other and to the internet.
The module on my hand is composed of CPU TI AM3358 and it's eth0 is connected with a PHY chip, eth1 is connected with the L2 Marvell MV88e6071 switch.

When I change VLANs'IP on linux system with separate subnet like eg1 or different subnet like eg2, both of them can be ping by a PC's IP. But the PC's IP can ping the other VLANs' IP at the same time though they are not connected with anything but setup IP. For example, vlan 1 with IP 192.168.1.10 is connect with the PC with IP 192.168.1.12, vlan 2, vlan 3, vlan 4 is connected with nothing. In this case, PC not only can ping vlan 1, but also vlan 2, vlan 3, vlan 4, which make me confused, it just look like VLAN's function is gone.
I sure this case is induced by linux system, maybe there is something I'm not configuring out.

BTW, I can see the broadcast of VLANs is 0.0.0.0 when set with both eg1 and eg2 method.

eg1:
vlan 1 can be from 192.168.1.0/26
vlan 2 can be from 192.168.1.64/26
vlan 3 can be from 192.168.1.128/26
vlan 4 can be from 192.168.1.192/26
eg2:
vlan 1 can be set 192.168.1.10/24
vlan 2 can be set 192.168.2.20/24
vlan 3 can be set 192.168.3.30/24
vlan 4 can be set 192.168.4.40/24
 
Old 02-28-2023, 12:50 PM   #12
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 564

Rep: Reputation: Disabled
You mentioned kernel 4.19 but what linux version is running on it and do you have the module make/model?
I'm interested as it has potential.

eg1 and eg2 looks good.
your broadcast per each subnet should be like below
eg1:
vlan 1 can be from 192.168.1.0/26 192.168.1.63
vlan 2 can be from 192.168.1.64/26 192.168.1.127
vlan 3 can be from 192.168.1.128/26 192.168.1.191
vlan 4 can be from 192.168.1.192/26 192.168.1.255
eg2:
vlan 1 can be set 192.168.1.10/24 192.168.1.255
vlan 2 can be set 192.168.2.20/24 192.168.2.255
vlan 3 can be set 192.168.3.30/24 192.168.3.255
vlan 4 can be set 192.168.4.40/24 192.168.4.255


lets say your pc ip address is connected to an access port on vlan 3 with those settings: 192.168.1.150 mask 255.255.255.192 and gateway is 192.168.1.129
For it to be able to talk to devices on the other subnets, 'inter-vlan' routing on must be enabled/configured on the gateway.
 
Old 03-01-2023, 10:46 AM   #13
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by yvesjv View Post
You mentioned kernel 4.19 but what linux version is running on it and do you have the module make/model?
I'm interested as it has potential.

eg1 and eg2 looks good.
your broadcast per each subnet should be like below
eg1:
vlan 1 can be from 192.168.1.0/26 192.168.1.63
vlan 2 can be from 192.168.1.64/26 192.168.1.127
vlan 3 can be from 192.168.1.128/26 192.168.1.191
vlan 4 can be from 192.168.1.192/26 192.168.1.255
eg2:
vlan 1 can be set 192.168.1.10/24 192.168.1.255
vlan 2 can be set 192.168.2.20/24 192.168.2.255
vlan 3 can be set 192.168.3.30/24 192.168.3.255
vlan 4 can be set 192.168.4.40/24 192.168.4.255


lets say your pc ip address is connected to an access port on vlan 3 with those settings: 192.168.1.150 mask 255.255.255.192 and gateway is 192.168.1.129
For it to be able to talk to devices on the other subnets, 'inter-vlan' routing on must be enabled/configured on the gateway.
It's an embedded system based on LINUX kernel and ROOTFS running our APPs' function after startup.The module is customer customization and this project is in during development. I'm afraid I can not give this module to you, but I can share more information to you if you have interested on it.

Thank you very much for your help, VLANs are much more better after setting of broadcast address.
 
Old 03-01-2023, 11:54 AM   #14
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 564

Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by Andy.liu View Post
It's an embedded system based on LINUX kernel and ROOTFS running our APPs' function after startup.The module is customer customization and this project is in during development. I'm afraid I can not give this module to you, but I can share more information to you if you have interested on it.

Thank you very much for your help, VLANs are much more better after setting of broadcast address.
Yes please, more information.
Everybody here would be very interested into the hardware capabilities of the physical device.
Can you also add a wireless module to it?
 
Old 03-03-2023, 01:35 AM   #15
Andy.liu
LQ Newbie
 
Registered: Feb 2023
Posts: 17

Original Poster
Rep: Reputation: 2
The module has 1 port of CAN, 4 ports of RS485, and six ports of Internet, as you know one is from eth0 and five are from switch. But it doesn't have WIFI because stable communication is at first, cable is much more reliable. USB port are support too, maybe WIFI with usb port can be used if need.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IoT(Linux) is seen at server (ip neigh | grep REACH) but when we ping server we can’t. If we restart IoT the ping happens 1 out 2 times but dev@ipssi.com Linux - Networking 2 09-03-2021 12:53 AM
[SOLVED] Can ping & ping6 into Centos7 server from outside & can ping out, but can't ping6 out ftbseobrad Linux - Server 3 02-09-2017 08:43 PM
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
Well well well..what do we have here? DaBlade Linux - News 4 10-03-2005 10:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration