| Linode Forum https://forum.linode.com/ |
|
| Shorewall, public ip, and private ip https://forum.linode.com/viewtopic.php?f=19&t=9421 |
Page 1 of 1 |
| Author: | sithlord2 [ Sat Sep 29, 2012 12:23 pm ] |
| Post subject: | Shorewall, public ip, and private ip |
Hi, I want to use Shorewall as the firewall config tool on my Linode, but I can't figure out how I need to config my zones. The problem is that linode uses aliases for the private ip range (eth0:1). It seems to me that I can't put those in separate zones? Also, it seems that there is a bit of contradiction between the Linode set-up guide for the private ip, and the Shorewall documentation on ethernet-aliases. According to linode, the private ip should be setup like this: === # eth0:1 - Private IPs have no gateway (they are not publicly routable) so all you need to # specify is the address and netmask. iface eth0:1 inet static address 192.168.133.234 netmask 255.255.128.0 === But Shorewall recommends another way: === # Internet interface auto eth0 iface eth0 inet static address 206.124.146.176 netmask 255.255.255.0 gateway 206.124.146.254 up ip addr add 206.124.146.178/24 brd 206.124.146.255 dev eth0 label eth0:0 === I don't quite understand the difference between these two different ways to configure the ethernet-alias. I'm not even sure it really matters for Linode or Shorewall. Then there is the matter of having one zone per addresses. According to the Shorewall documentation, this is possible with Linux vServer support (?), but I can't figure out how to set it up. I hope someone can help me with this, because it all seems much harder than it has to be... |
|
| Author: | hoopycat [ Sat Sep 29, 2012 12:56 pm ] |
| Post subject: | Re: Shorewall, public ip, and private ip |
Either network configuration will work just fine, and will produce the same system state. I've done both from time to time. The advantage of the "iface" approach is that you've got each address separated into logical configuration stanzas; the advantage of the "up" approach is that you only need one line per IP address. I use a combo of the two approaches currently: Code: # The loopback network interface |
|
| Author: | sithlord2 [ Sat Sep 29, 2012 1:10 pm ] |
| Post subject: | Re: Shorewall, public ip, and private ip |
Thanks for the info I'm still in the dark on how to configure the shorewall zones. Would something like this work: zones file: Code: === interfaces file: Code: === hosts file: Code: === To be honest, I don't know what to fill in my hosts file for the "loc" zone. According to Linode my private ip is 192.168.195.3/255.255.128.0, but I'm not sure how I should convert this to a format that shorewall understands. I still wonder why Linode can't provide a separate virtual adapter for the private range. It would make firewall setup so much easier. A virtual adapter is just a piece of software, and wouldn't consume any additional resources. |
|
| Author: | obs [ Sat Sep 29, 2012 5:38 pm ] |
| Post subject: | Re: Shorewall, public ip, and private ip |
Shorewall is easier than you think to setup for private/public ips. Your zones file should have one ipv4 zone (let's call it net) then in your rules file you specify the IP i.e. Code: #ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK The above allows SSH on the ip 1.2.3.4 any other IPs would be dropped (assuming your default policy is to drop). |
|
| Author: | sithlord2 [ Sun Sep 30, 2012 9:22 am ] |
| Post subject: | Re: Shorewall, public ip, and private ip |
Thanks, that does look a lot easier. One final question: What's the difference between using '$FW' and using the zone 'fw' (as specified in the zones file by default) in your rules file? |
|
| Author: | obs [ Mon Oct 01, 2012 4:29 am ] |
| Post subject: | Re: Shorewall, public ip, and private ip |
$FW is a variable which represents the fw zone, so you can change the fw zone name and it'd still work. Apart from that they're the same it doesn't matter which you use. |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|