防火墙在RAC上的配置

RAC两台服务器的/etc/hosts都是如下

127.0.0.1             localhost localhost.localdomain   localhost4      localhost4.localdomain4

::1                   localhost localhost.localdomain   localhost6      localhost6.localdomain6

192.168.130.200       hdba              hdba

192.168.130.201       hdbb hdbb       hdbb

192.168.130.135       hdb-cluster       hdb-cluster

192.168.130.136       hdb-cluster-scan  hdb-cluster-scan

192.168.130.137       hdba-vip          hdba-vip

192.168.130.138       hdbb-vip          hdbb-vip

192.168.148.200       hdba-priv         hdba-priv

192.168.148.201       hdbb-priv         hdbb-priv

192.168.130.208       hdg               hdg



A实例服务器的ip信息

[root@hdba ~]# ifconfig

eth0      Link encap:Ethernet  HWaddr 5C:B9:01:99:3A:84

          inet addr:192.168.148.200  Bcast:192.168.148.255  Mask:255.255.255.0

          inet6 addr: fe80::5eb9:1ff:fe99:3a84/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2783160300 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2925124606 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2205601483366 (2.0 TiB)  TX bytes:2420649621403 (2.2 TiB)


eth0:1    Link encap:Ethernet  HWaddr 5C:B9:01:99:3A:84

          inet addr:169.254.221.245  Bcast:169.254.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth1      Link encap:Ethernet  HWaddr 5C:B9:01:99:3A:85

          inet addr:192.168.130.200  Bcast:192.168.130.255  Mask:255.255.255.0

          inet6 addr: fe80::5eb9:1ff:fe99:3a85/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:7365390091 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8297092138 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2046603688342 (1.8 TiB)  TX bytes:6835745161060 (6.2 TiB)


eth1:2    Link encap:Ethernet  HWaddr 5C:B9:01:99:3A:85

          inet addr:192.168.130.137  Bcast:192.168.130.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1



B实例服务器的ip信息

[root@hdbb ~]# ifconfig

eth0      Link encap:Ethernet  HWaddr 5C:B9:01:99:38:24

          inet addr:192.168.148.201  Bcast:192.168.148.255  Mask:255.255.255.0

          inet6 addr: fe80::5eb9:1ff:fe99:3824/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2925138277 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2783173132 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2420675528287 (2.2 TiB)  TX bytes:2205594234468 (2.0 TiB)


eth0:1    Link encap:Ethernet  HWaddr 5C:B9:01:99:38:24

          inet addr:169.254.205.69  Bcast:169.254.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth1      Link encap:Ethernet  HWaddr 5C:B9:01:99:38:25

          inet addr:192.168.130.201  Bcast:192.168.130.255  Mask:255.255.255.0

          inet6 addr: fe80::5eb9:1ff:fe99:3825/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:6957519128 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8365702494 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2024616025362 (1.8 TiB)  TX bytes:7204587376017 (6.5 TiB)


eth1:1    Link encap:Ethernet  HWaddr 5C:B9:01:99:38:25

          inet addr:192.168.130.138  Bcast:192.168.130.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1




两台服务器的防火墙配置都一样,配置文件/etc/sysconfig/iptables内容如下

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT


#来自心跳网卡的数据都放行

-A INPUT -i eth0 -j ACCEPT

-A INPUT -i eth0:1 -j ACCEPT


#vip和scan ip放行

#本来A实例的vip去访问B实例,在B实例防火墙添加A实例的vip,为了使两台服务器的防火墙配置一样,就把A实例和B实例的vip都放行

-A INPUT -s 192.168.130.200/32 -j ACCEPT

-A INPUT -s 192.168.130.201/32 -j ACCEPT

-A INPUT -s 192.168.130.137/32 -j ACCEPT

-A INPUT -s 192.168.130.138/32 -j ACCEPT

-A INPUT -s 192.168.130.135/32 -j ACCEPT

-A INPUT -s 192.168.130.136/32 -j ACCEPT


#信任IP列表,/24表示整个网段都开放,/32表示只开放这个IP

-A INPUT -s 10.10.23.0/24 -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT

-A INPUT -s 172.31.210.0/24 -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT

-A INPUT -s 192.168.74.0/24 -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT

-A INPUT -s 192.168.128.137/32 -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT


-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited


COMMIT

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30126024/viewspace-2213677/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30126024/viewspace-2213677/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值