All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Neal Probert <nprobert@probestar.net>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: CAN firewall
Date: Fri, 30 Oct 2015 15:38:54 +0100	[thread overview]
Message-ID: <563380FE.9090207@hartkopp.net> (raw)
In-Reply-To: <5633659E.3010008@probestar.net>

Hi Neal,

long time no see :-)

On 10/30/2015 01:42 PM, Neal Probert wrote:
> Is there any sort of CAN firewall/gateway capability like
> ipfilter/iptables available?

First thing is to use the CAN filters provided by CAN_RAW sockets:

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/networking/can.txt?h=linux-4.2.y#n436

which provides a 'private' view to the CAN interface for each socket.
These filters are provided by the candump commandline options too.

In the case you don't trust the CAN application(??), you might try to limit
your untrusted application to use a virtual CAN (e.g. vcan0) and forward the
traffic from/to the 'real' can0 via can-gw rules.

Try 'cangw -?' from the can-utils package for a full feature description.
You can route and modify CAN frames from one CAN interface to another.

(But don't forget to modprobe can-gw before as it doesn't autoload)

The can-gw is a netlink configuration based routing an modifying functionality
for CAN frames.

Hope that helps so far - can you tell more about your use-case?

Regards,
Oliver

      reply	other threads:[~2015-10-30 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 12:42 CAN firewall Neal Probert
2015-10-30 14:38 ` Oliver Hartkopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563380FE.9090207@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=nprobert@probestar.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.