1. Store
  2. Apps
  3. Hardware
  4. Support
  5. Solutions

ClearFoundation

Forums
Welcome, Guest
How to configure eth0:1 firewall rules
(1 viewing) 1 Guest
Go to bottomPage: 1
TOPIC: How to configure eth0:1 firewall rules
#4229
How to configure eth0:1 firewall rules 3 Years, 4 Months ago  
I have added firewall rules, eth0 works fine, but they do not allow traffic to the alias on the card.

I have eth0 and eth0:1 which are both active.

How do I add rules to eth0:1?

Also, where are the rules kept. I ran iptables-save and the output does not show the current rules.

Thanks in Adavance
bdorsey63
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#4233
Re:How to configure eth0:1 firewall rules 3 Years, 4 Months ago  
Solution :

1. iptables-save does show the firewall rules (but for some reason, I had to issue a /etc/init.d/firewall restart, before it was current)
2. I found /etc/rc.d contains firewall rule files including rc.firewall.local which says clearly that

"
# Custom firewall rules.
# This file is executed by the firewall on stop/start/restart.
"

so i added the following:

iptables -A INPUT -d x.x.x.10 -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -d x.x.x.10 -p tcp -m tcp --dport 53 -j ACCEPT
iptables -A INPUT -d x.x.x.10 -p udp -m udp --dport 53 -j ACCEPT

where
x.x.x.10 is the address of the alias eth0:1

I issued the

/etc/init.d/firewall restart

I looked at the firewall rules

iptables -L -n

The rules where there, great. I removed them restarted named and they were gone. I added them back and restarted, they were there. I did not reboot, but they should still work on reboot.

A nice tweak would be to add logic to the GUI, such that, when an alias exists before the firewall rules are added then both IPs will get the same rule. Or perhaps, just adding that to the advance options, where you have to pick an IP address or all for a particular interface.


So all is good!
bdorsey63
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/01/26 16:52 By bdorsey63.
The administrator has disabled public write access.
 
#4255
Re:How to configure eth0:1 firewall rules 3 Years, 3 Months ago  
You should use the -I flag instead of the -A flag otherwise they will be appended to the bottom of the chain, and occur after the default 'DROP' everything else rule

Thanks for posting your solution...I think you have to use the advanced firewall module for forwarding traffic to virtual interfaces, which effectively achieves the same as you have above
Code:

yum install app-firewall-advanced

Tim Burgess
Moderator
Posts: 5802
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#4300
Re:How to configure eth0:1 firewall rules 3 Years, 3 Months ago  
Thanks for the update:

I tried both, adding the I and using the advanced rules. Both worked.
bdorsey63
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
  get the latest posts directly to your desktop