Skip to content

cangw and multiple vcan #483

Open
Open
@pompushko

Description

@pompushko

Hello.

I have a strange issue with cangw and 2 virtual CANs.

cat /etc/network/interfaces.d/vcan0

auto vcan0
iface vcan0 inet manual
        pre-up /sbin/ip link add dev $IFACE type vcan
        pre-up /sbin/ip link set dev $IFACE mtu 16
        up /sbin/ifconfig $IFACE up mtu 16
        down /sbin/ifconfig $IFACE down
        post-up /usr/bin/cangw -A -s vcan0 -d can0 -e -f 98DA00F1:DFFF00FF
        post-up /usr/bin/cangw -A -s can0 -d vcan0 -e -f 98DAF100:DFFFFF00

cat /etc/network/interfaces.d/vcan1

auto vcan1
iface vcan1 inet manual
        pre-up /sbin/ip link add dev $IFACE type vcan
        pre-up /sbin/ip link set dev $IFACE mtu 16
        up /sbin/ifconfig $IFACE up mtu 16
        down /sbin/ifconfig $IFACE down
        post-up /usr/bin/cangw -A -s vcan1 -d can1 -e -f 98DA00F1:DFFF00FF
        post-up /usr/bin/cangw -A -s can1 -d vcan1 -e -f 98DAF100:DFFFFF00

My cangw rules works strange:

cangw -A -s can1 -d vcan1 -e -f 98DAF100:DFFFFF00 # 0 handled 0 dropped 0 deleted
cangw -A -s vcan1 -d can1 -e -f 98DA00F1:DFFF00FF # 12 handled 0 dropped 0 deleted           <=
cangw -A -s can0 -d vcan0 -e -f 98DAF100:DFFFFF00 # 18 handled 0 dropped 0 deleted           <=
cangw -A -s vcan0 -d can0 -e -f 98DA00F1:DFFF00FF # 0 handled 0 dropped 0 deleted

Some of mine packets go to second virtual interface, but should go to first one.
Very strange...

Or my rules are bad?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions