WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: VLAN Configuration  (Read 2874 times)

Offline aj

  • Newbie
  • *
  • Posts: 34
VLAN Configuration
« on: April 11, 2023, 05:16:45 AM »
Hello,
I'm testing an automotive ethernet interface (FibreCode FC602) with TinyCore 13.
I want to enable the communication between my computer and another module.
The other module has the IP address 169.254.112.74 and requires a VLAN configuration.

I've executed the following steps to configure the VLAN:
(the automotive ethernet interface is detected as eth1)
Code: [Select]
> install the iproute2 extension
> sudo ip link add link eth1 name vlan1 type vlan id 1
> sudo ip addr add 169.254.112.70/24 dev vlan1
> sudo ip link set eth1 up
> sudo ip link set vlan1 up

To test the communication I want to execute the command ping successfully.
However I can't get a response from the other module.

I've decided to spy the ethernet communication with tcpdump and the module response is received in my computer.
Log data:

Code: [Select]
18:01:49.373189 IP 169.254.112.70 > 169.254.112.74: ICMP echo request, id 805, seq 0, length 64
0x0000:  3cce 1501 004a fcc2 3d30 88a7 8100 0001  <....J..=0......
0x0010:  0800 4500 0054 e3e7 4000 4001 2234 a9fe  ..E..T..@.@."4..
0x0020:  7046 a9fe 704a 0800 20e7 0325 0000 f33f  pF..pJ.....%...?
0x0030:  e0b3 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                           ......
18:01:49.378365 IP 169.254.112.74 > 169.254.112.70: ICMP echo reply, id 805, seq 0, length 40
0x0000:  fcc2 3d30 88a7 3cce 1501 004a 8100 0001  ..=0..<....J....
0x0010:  0800 4500 003c f4a8 4000 4001 118b a9fe  ..E..<..@.@.....
0x0020:  704a a9fe 7046 0000 28e7 0325 0000 f33f  pJ..pF..(..%...?
0x0030:  e0b3 0000 0000 0000 0000 0000 0000 0000  ................
0x0040:  0000 0000 0000 0000 0000 0000 0000       ..............

The complete log is attached.

I did some tests with ubuntu and executed the same configuration steps and the ping is done successfully.
So the hardware setup is working correctly.

In TinyCore I've updated the IP routing table to change the default gateway to 169.254.112.74 or ...70 but the result is the same.

So I would like to get some help to debug this configuration problem.

Your help is greatly appreciated.

    [EDIT]: Added code tags.  Rich
« Last Edit: April 12, 2023, 09:09:10 PM by Rich »

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 708
Re: VLAN Configuration
« Reply #1 on: April 11, 2023, 07:34:35 AM »
My first thoughts will be....can it be the speed and duplex thingy.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11589
Re: VLAN Configuration
« Reply #2 on: April 11, 2023, 09:23:18 AM »
Hi aj
You could try using the  sysctl  command to see if any settings are blocking you.
For example:
Code: [Select]
sudo sysctl -a 2>&1 | grep -i icmp
sudo sysctl -a 2>&1 | grep -i vlan

Offline aj

  • Newbie
  • *
  • Posts: 34
Re: VLAN Configuration
« Reply #3 on: April 12, 2023, 12:48:33 PM »
Hi aj
You could try using the  sysctl  command to see if any settings are blocking you.
For example:
Code: [Select]
sudo sysctl -a 2>&1 | grep -i icmp
sudo sysctl -a 2>&1 | grep -i vlan

Hi Rich,

Thank you for the support.

Output from sysctl for icmp:
Code: [Select]
net.ipv4.icmp_echo_enable_probe = 0
net.ipv4.icmp_echo_ignore_all = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_errors_use_inbound_ifaddr = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.icmp_msgs_burst = 50
net.ipv4.icmp_msgs_per_sec = 1000
net.ipv4.icmp_ratelimit = 1001
net.ipv4.icmp_ratemask = 6168



Output from sysctl for vlan:
Code: [Select]
net.ipv4.conf.all.proxy_arp_pvlan = 0
net.ipv4.conf.default.proxy_arp_pvlan = 0
net.ipv4.conf.dummy0.proxy_arp_pvlan = 0
net.ipv4.conf.eth0.proxy_arp_pvlan = 0
net.ipv4.conf.eth1.proxy_arp_pvlan = 0
net.ipv4.conf.lo.proxy_arp_pvlan = 0
net.ipv4.conf.tunl0.proxy_arp_pvlan = 0
net.ipv4.conf.vlan1.accept_local = 0
net.ipv4.conf.vlan1.accept_redirects = 1
net.ipv4.conf.vlan1.accept_source_route = 1
net.ipv4.conf.vlan1.arp_accept = 0
net.ipv4.conf.vlan1.arp_announce = 0
net.ipv4.conf.vlan1.arp_filter = 0
net.ipv4.conf.vlan1.arp_ignore = 0
net.ipv4.conf.vlan1.arp_notify = 0
net.ipv4.conf.vlan1.bc_forwarding = 0
net.ipv4.conf.vlan1.bootp_relay = 0
net.ipv4.conf.vlan1.disable_policy = 0
net.ipv4.conf.vlan1.disable_xfrm = 0
net.ipv4.conf.vlan1.drop_gratuitous_arp = 0
net.ipv4.conf.vlan1.drop_unicast_in_l2_multicast = 0
net.ipv4.conf.vlan1.force_igmp_version = 0
net.ipv4.conf.vlan1.forwarding = 0
net.ipv4.conf.vlan1.igmpv2_unsolicited_report_interval = 10000
net.ipv4.conf.vlan1.igmpv3_unsolicited_report_interval = 1000
net.ipv4.conf.vlan1.ignore_routes_with_linkdown = 0
net.ipv4.conf.vlan1.log_martians = 0
net.ipv4.conf.vlan1.mc_forwarding = 0
net.ipv4.conf.vlan1.medium_id = 0
net.ipv4.conf.vlan1.promote_secondaries = 0
net.ipv4.conf.vlan1.proxy_arp = 0
net.ipv4.conf.vlan1.proxy_arp_pvlan = 0
net.ipv4.conf.vlan1.route_localnet = 0
net.ipv4.conf.vlan1.rp_filter = 0
net.ipv4.conf.vlan1.secure_redirects = 1
net.ipv4.conf.vlan1.send_redirects = 1
net.ipv4.conf.vlan1.shared_media = 1
net.ipv4.conf.vlan1.src_valid_mark = 0
net.ipv4.conf.vlan1.tag = 0
net.ipv4.neigh.vlan1.anycast_delay = 99
net.ipv4.neigh.vlan1.app_solicit = 0
net.ipv4.neigh.vlan1.base_reachable_time = 30
net.ipv4.neigh.vlan1.base_reachable_time_ms = 30001
net.ipv4.neigh.vlan1.delay_first_probe_time = 5
net.ipv4.neigh.vlan1.gc_stale_time = 60
net.ipv4.neigh.vlan1.locktime = 99
net.ipv4.neigh.vlan1.mcast_resolicit = 0
net.ipv4.neigh.vlan1.mcast_solicit = 3
net.ipv4.neigh.vlan1.proxy_delay = 79
net.ipv4.neigh.vlan1.proxy_qlen = 64
net.ipv4.neigh.vlan1.retrans_time = 99
net.ipv4.neigh.vlan1.retrans_time_ms = 1001
net.ipv4.neigh.vlan1.ucast_solicit = 3
net.ipv4.neigh.vlan1.unres_qlen = 91
net.ipv4.neigh.vlan1.unres_qlen_bytes = 180224

Can you see anything incorrect?

    [EDIT]: Added code tags.  Rich
« Last Edit: April 12, 2023, 09:07:44 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11589
Re: VLAN Configuration
« Reply #4 on: April 12, 2023, 09:11:27 PM »
Hi aj
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11589
Re: VLAN Configuration
« Reply #5 on: April 12, 2023, 09:23:07 PM »
Hi aj
... Can you see anything incorrect?
Those are a lot of settings, and I don't know what most of them do.

I can offer a couple of suggestions:
1. Look up the settings to see what they do here:
   https://docs.kernel.org/networking/ip-sysctl.html

Or:
2. Do the same setup in Ubuntu and run the sysctl commands there. Then
   compare the results to what you got under Tinycore.

While in Ubuntu, you might also want to check routing information.

Offline aj

  • Newbie
  • *
  • Posts: 34
Re: VLAN Configuration
« Reply #6 on: April 13, 2023, 06:10:57 AM »
Hi aj
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.

Hi Rich,

I will use code tags in future posts.
Thank you.

Offline aj

  • Newbie
  • *
  • Posts: 34
Re: VLAN Configuration
« Reply #7 on: April 13, 2023, 06:31:17 AM »
Hi aj
... Can you see anything incorrect?
Those are a lot of settings, and I don't know what most of them do.

I can offer a couple of suggestions:
1. Look up the settings to see what they do here:
   https://docs.kernel.org/networking/ip-sysctl.html

Or:
2. Do the same setup in Ubuntu and run the sysctl commands there. Then
   compare the results to what you got under Tinycore.

While in Ubuntu, you might also want to check routing information.

Hi Rich,

I've compared the sysctl outputs from tinycore and ubuntu but I don't have experience in vlan configuration and I don't know these parameters meaning so I will look in the documentation to understand them.
There are some parameters in ubuntu that don't exist in tinycore.

The routing table in ubuntu is defined by one rule:
Code: [Select]
169.254.112.0/24 dev vlan1 proto kernel scope link src 169.254.112.51
I updated the tinycore routing table to be the same but no result.

Before execute the vlan configuration I've tried to load the module 8021q but also didn't work.
Code: [Select]
sudo modprobe 8021q
According to the tcpdump, the ping request is sent and the reply is received so problably the issue is related to some configuration that is blocking the reply to the ping application.

Thank you for your support.

Offline aj

  • Newbie
  • *
  • Posts: 34
Re: VLAN Configuration
« Reply #8 on: April 14, 2023, 12:45:23 PM »
Hello,

I did some tests using Ubuntu and for each ping response the output shows the additional message "(truncated)".
This message is displayed when there is a mismatch between the sent and received data size.
In TinyCore ping command, the default data size is 56 bytes.
I've changed the ping data size to a lower value using the parameter "-s" and now I can get the reply from the another device.
So the TinyCore ping application has a different behaviour compared to Ubuntu and the other device has a limitation regarding to the packet size.

Thank you all for your support.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11589
Re: VLAN Configuration
« Reply #9 on: April 14, 2023, 10:36:13 PM »
Hi aj
Glad to hear you got it figured out. By the way, ping is provided by
busybox in a stock install. The GNU version of ping is provided by
inetutils.tcz and may behave differently than the busybox version.