Great, very useful. Thanks Tom!

A couple of points though as I don't quite seem to be there yet with
netmap or ADD_DNAT_ADDRS.

There's no ADD_DNAT_ADDRS in shorewall.conf. Adding it caused shorewall
start to spit it out. Perhaps you meant ADD_IP_ALIASES, or even
ADD_SNAT_ALIASES, but neither seemed to result in additional ip
addresses on the interface as shown by the GUI. So as a stopgap, I
recreated them manually.

There's no annotated (or plain) netmap file that I can see, so I created
one containing:

DNAT  ${Schlnet}.128/27 eth0 ${Pinet}.0/27  -  tcp  ssh
DNAT  ${Schlnet}.128/27 eth0 ${Pinet}.0/27  -  tcp  5900

(in order to map a 32-address block at eth0 to a corresponding block at
eth1).

I was gratified that shorewall start showed it as compiled without
complaint, but I couldn't ping or ssh the Pinet host through the Schlnet
ip address.

The docs say I need NETMAP support, but shorewall show capabilities
doesn't show it. I guess I need to recompile the kernel - hopefully just
a case of setting CONFIG_IP_NF_TARGET_NETMAP=y in a file somewhere and
typing make. I don't expect you to tell me how to do that but any quick
pointers would be appreciated (Linux Mint - based on Ubuntu - based on
Debian as I understand).

Regards - Philip


On 08/04/2014 22:48, Tom Eastep wrote:
> On 4/8/2014 2:01 PM, Philip Le Riche wrote:
>> Folks -
>>
>> New round these parts (though not to firewalls), so please bear with any
>> stoopid questions.
>>
>> I'm setting up Shorewall on a Linux Mint box in order to isolate a
>> Raspberry Pi farm in a school, allowing access by ssh and vnc from
>> school PCs and the Pis to access the Internet for updates and package
>> downloads. Pretty much all else unnecessary is blocked. After a fairly
>> thrilling scramble up the learning curve it all seems to work and just
>> needs validating and tidying up. One or two questions have arisen on the
>> way though:
>>
>> 1. I'm using DNAT to map the Pi ip addresses (on their own private
>> subnet) onto addresses on the school network. I did something logically
>> similar some years ago for a completely different application, which I
>> did with static NAT on a Cisco PIX. In that case, the PIX determined
>> that it had an interest in those pre-NATted ip addresses and responded
>> to ARP requests for them just as part of the day job. I vaguely assumed
>> the same would happen here until I realised I'd probably have to
>> explicitly add the pre-NATted ip addresses to the outer interface, which
>> I did by hand. Question: would Shorewall have done that for me if I'd
>> been a bit more patient? Maybe I went ahead before I'd got Shorewall to
>> understand where I was going with this.
> Check out the ADD_DNAT_ADDRS in shorewall.conf.
>
>> 2. I'd like to parameterise this where I can to facilitate reuse in
>> other schools if it turned out to be useful. I've just stumbled across
>> the params file, which I don't remember seeing on my way up the learning
>> curve, but on the face of it, it only appears to allow parameterisation
>> of complete lexical items. But having done a bit of shell and Perl in my
>> time I was tempted to try:
>>     Schoolnet=172.16.1
>>     Pinet=192.168.1
>> and in my rules, brandish something like:
>>     DNAT    skool    pinet:${Pinet}.1    tcp    ssh    ${Schoolnet}.129
>> (There will need to be a number of such lines.) It seems to work. Am I
>> playing with fire?
> That should work fine.
>
>> 3. Is there a more succinct way of performing a linear mapping of one
>> block of ip addresses onto another, rather than repeated lines as above?
>> I thought I could map one CIDR range onto another with the PIX, but my
>> memory is a bit hazy from more than 10 years ago.
> Check out http://www.shorewall.org/netmap.html
>
>> 4. Changing DROP to REJECT quickly found my last bug, but I never got
>> logging to work. I created /var/log/messages in order to eliminate an
>> error, but putting debug in the LOG LEVEL field of the policy file
>> didn't do anything. In fact, I've never had anything  beyond the startup
>> message in /var/log/messages. I've never had occasion to more than
>> scratch the surface of syslog so this may be a silly question. Is there
>> something I'm missing?
> http://www.shorewall.org/shorewall_logging.html
>
>> Anyway, great work Tom. Having quickly dismissed gufw and geared myself
>> up if necessary to fight with raw iptables, you've saved me a lot of work!
> Thanks Philip!
>
> -Tom
>
>
> ------------------------------------------------------------------------------
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment 
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
>
>
> _______________________________________________
> Shorewall-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/shorewall-users

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to