LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2011, 05:11 AM   #1
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Rep: Reputation: Disabled
IPtables seem to be blocking internal traffic


Dear all,

I went thru other threads and nothing seems to be like this. I am cracking my head over this.

I have set some Iptables in the load balancer (LVS) and the problem is, it is blocking my internal traffic. My internal traffic is at 172.31.13.xx and 10.103.xx.x... 83.x.x.x is the public address

The load balancer is configured to accept calls from outside the cluster and balances the load to one of the 3 app servers.

However from the webserver we have to call a url on port 8880 which we also want to go via the load balancer. e.g. if we always would connect to app server 1 and app server 1 is down, there is a problem. but somehow the call never reaches the app server, so somewhere on the load balancer the call is blocked.

when I call the url from outside the cluster it works fine.

I am thinking its the iptables...

help help



# Generated by iptables-save v1.3.5 on Thu Dec 16 10:40:00 2010
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [104956494:7410857183]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -d 172.30.232.135 -p tcp -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -d 172.30.232.136 -p tcp -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -s 83.96.144.9 -p tcp -m tcp --dport 3306 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.103.0.0/255.255.0.0 -j ACCEPT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2675 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2135 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2136 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.103.0.0/255.255.0.0 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

# Allow port 80 only when accessed from the cluster
# -A RH-Firewall-1-INPUT -s 10.103.0.0/255.255.0.0 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
# -A RH-Firewall-1-INPUT -s 10.103.0.0/255.255.0.0 -p tcp -m state --state NEW -m tcp --dport 8880 -j ACCEPT

# Only allow port 80 from outside the cluster to the web server
-A RH-Firewall-1-INPUT -d 195.88.18.13 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -d 195.88.18.12 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -d 195.88.18.11 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -d 195.88.18.8 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
# -A RH-Firewall-1-INPUT -d 195.88.18.8 -p tcp -m state --state NEW -m tcp --dport 8880 -j ACCEPT

# MySQL access from outside the cluster to the reporting server
-A RH-Firewall-1-INPUT -d 195.88.18.13 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

# -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

-A RH-Firewall-1-INPUT -d 10.103.4.40 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Thu Dec 16 10:40:00 2010
# Generated by iptables-save v1.3.5 on Thu Dec 16 10:40:00 2010
*nat
:PREROUTING ACCEPT [58628481:16860954476]
:POSTROUTING ACCEPT [133127:10110394]
:OUTPUT ACCEPT [34649975:2081168594]
-A PREROUTING -d 195.88.18.200 -i bond0.18 -p tcp -j DNAT --to-destination 10.103.4.40
-A POSTROUTING -s 10.103.0.0/255.255.0.0 -j MASQUERADE
COMMIT
# Completed on Thu Dec 16 10:40:00 2010

Last edited by hsnanua; 08-23-2011 at 05:12 AM.
 
Old 08-23-2011, 07:43 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
It's too difficult to read like that.

Let's start from the begining:

Code:
ip link show
ip addr show
ip route show
iptables -L -nv
Then, you say the traffic is not being forwarded by the load balancer. Can you start tcpdump on the interface that's receiving the requests and show us the output when some traffic is sent to the load balancer? Another tcpdump session on the interface that's pointing to the real servers at the same time and showing us the output when the requests are made would be nice.
 
Old 08-23-2011, 11:13 PM   #3
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
diagnosis

Hi,

here you so, attached is the diagnosis.. i cant see anything much wrong with it..

The system is running on LVS...

Thanks
Attached Files
File Type: pdf diagnosis.pdf (109.1 KB, 24 views)
 
Old 08-23-2011, 11:18 PM   #4
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
tcp dump

will send the tcp dump by today... thanks
 
Old 08-23-2011, 11:36 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
What is the value in net.ipv4.ip_forward?

Code:
$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0
And did it ever work?
 
Old 08-23-2011, 11:51 PM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Oh.... I think the value in net.ipv4.ip_forward doesn't matter. Traffic is forwarded from the application layer, not ip. By the way, don't the requests that land at the vls process get reported about on a log?
 
Old 08-23-2011, 11:51 PM   #7
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
value

Hi,

the value is 1


[root@lb-01 ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1


thanks
 
Old 08-24-2011, 01:32 AM   #8
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
Currently I have configured in ipvsadm that from external ip (VIP) 195.88.18.8 port 8880 will be load balanced to the app servers. In keepalived.conf I configured the same. Instead of using 195.89.18.8 I also tried 10.104.0.1 which is the internal IP of the load balancer. Reason for that is that from the web server (10.103.6.1 we want to reach the app servers on port 8880. There is no need for external clients to reach the app servers.

One thought I had on that was that in keepalived you also need to specify the virtual ips. I tried that for 10.103.0.1 but no luck. So maybe you have some thoughts on that...

note :195.89.x.x is the external ip
10.104 is the internal ip of the load balancer

Load balancer running on LVS

Thanks
 
Old 08-24-2011, 05:33 AM   #9
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
keepalived

Could it because of the keepalived... since there is virtual ips being inserted, there is a possibility that somehwere along the line, there is an error....

attached is the keepalived conf..

help.. thanks
Attached Files
File Type: pdf keepalived.pdf (65.2 KB, 12 views)
 
Old 08-24-2011, 09:39 AM   #10
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
When you are running your tests, what is the originating IP address and the receiving IP address on the load balancing server? (you have a little complicated set up :-)).
 
Old 08-24-2011, 11:00 PM   #11
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
Hi,

When i run the tests, I run from the webserver we have to call a url on port 8880 which I also want to go via the load balancer.

e.g. if we always would connect to app server 1 and app server 1 is down, there is a problem. but somehow the call never reaches the app server, so somewhere on the load balancer the call is blocked.

the ips of the webservers (app server): 10.103.1.1-10.103.1.4

load balancer: 10.103.0.1, 10.103.0.2

Thanks
 
Old 08-24-2011, 11:41 PM   #12
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
So you are making the tests by browsing from the vls server itself? What is the output of netstat -lntp?
 
Old 08-25-2011, 12:00 AM   #13
hsnanua
Member
 
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
output:


[root@lb-01 ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address Stat e PID/Program name
tcp 0 0 127.0.0.1:199 0.0.0.0:* LIST EN 19821/snmpd
tcp 0 0 10.103.0.1:53 0.0.0.0:* LIST EN 30909/dnsmasq
tcp 0 0 10.103.0.1:22 0.0.0.0:* LIST EN 26948/sshd
tcp 0 0 :::1311 :::* LIST EN 31795/dsm_om_connsv
[root@lb-01 ~]#


Thank you
 
Old 08-25-2011, 08:25 AM   #14
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Interesting.... nothing about port 8080. It appears as if lvs is not listening on that port. Is it?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
blocking traffic using iptables -easy hopefully :) fedora_user Linux - Newbie 7 03-18-2010 05:34 AM
iptables, and blocking all but non network traffic Argo Linux - Security 11 06-18-2007 07:42 PM
iptables blocking traffic JJX Linux - Networking 4 11-07-2005 05:36 AM
Iptables blocking all traffic on other NIC spede Linux - Security 3 05-05-2004 05:37 PM
iptables blocking internal access? complus Linux - Networking 17 03-08-2004 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration