Hi!
I would kindly ask you for some help/advice in configuring IPFW.
I have two VMs with FreeBSD 9.0 installed.
On each machine:
There are two interfaces, em0 and em1.
em0 has public IP address assigned (a.b.c.d), while em1 has none.
There is a tunnel interface gif0 created (with target IP e.f.g.h).
There is a bridge interface bridge0 with members em1 and gif0.
I'm configuring them via SSH from IP i.j.k.l.
I would like to secure each machine at their em0 ("public") interface regarding following rules:
- accept incoming and outgoing EtherIP frames between those two endpoints
- allow to connect to the machine via SSH and to ping (ICMP and ARP is needed I think), from one IP address
- allow to ping (ICMP and ARP is needed I think) from the machine
- deny any other traffic
As far as I understand EtherIP implementation in FreeBSD, packets incoming at em1 will be sent through gif0 like regular packets, but it will be visible at em0 as EtherIP packets, right?
If so, then I thought of commands like those:
Is that more or less alright?
I'm starting with FreeBSD (UNIX at all), also such firewall tools are new to me.
Thanks in advance.
Regards,
Tomasz
I would kindly ask you for some help/advice in configuring IPFW.
I have two VMs with FreeBSD 9.0 installed.
On each machine:
There are two interfaces, em0 and em1.
em0 has public IP address assigned (a.b.c.d), while em1 has none.
There is a tunnel interface gif0 created (with target IP e.f.g.h).
There is a bridge interface bridge0 with members em1 and gif0.
I'm configuring them via SSH from IP i.j.k.l.
I would like to secure each machine at their em0 ("public") interface regarding following rules:
- accept incoming and outgoing EtherIP frames between those two endpoints
- allow to connect to the machine via SSH and to ping (ICMP and ARP is needed I think), from one IP address
- allow to ping (ICMP and ARP is needed I think) from the machine
- deny any other traffic
As far as I understand EtherIP implementation in FreeBSD, packets incoming at em1 will be sent through gif0 like regular packets, but it will be visible at em0 as EtherIP packets, right?
If so, then I thought of commands like those:
Code:
ipfw -q add allow etherip from e.f.g.h to a.b.c.d in via em0 #incoming EtherIP
ipfw -q add allow etherip from a.b.c.d to e.f.g.h out via em0 #outgoing EtherIP
ipfw -q add allow all from i.j.k.l to a.b.c.d in via em0 #for SSH and ping for me
ipfw -q add allow icmp from any to any out via em0 #for pings
ipfw -q add allow icmp from any to any in via em0 #for pings
ipfw -q add deny all from any to any #if every rule didn't match, the packet is not allowed
Is that more or less alright?
I'm starting with FreeBSD (UNIX at all), also such firewall tools are new to me.
Thanks in advance.
Regards,
Tomasz