LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   CentOS 4.1 hosting squid and advanced routing freezing mysteriously (http://www.linuxquestions.org/questions/linux-networking-3/centos-4-1-hosting-squid-and-advanced-routing-freezing-mysteriously-652558/)

dougbourne 06-30-2008 08:58 AM

CentOS 4.1 hosting squid and advanced routing freezing mysteriously
 
Hi folks,
i'm with a BIG problem and i dont know what to do.
I have an CentOS 4.1, this box are now hosting DNS,DHCP,SQUID and i'm using policy based routing with iproute+iptables to routing over two different links.

Before i set up this "PBR" configuration, all works fine. But some days later i configured pbr, my network comes freezing randomly, and it not showing any errors on logs.

I need help to solve this, because its very urgent and I dont know what can I do.

The scenario:
eth1 = lan 192.168.1.0/24
eth0 = internet link 1, dedicated ip.
dev28022 = internet link 2, dynamic ip. ***

*** i dont know why kudzu set up this name to interface.

hwconf:
-----------------------------------------------
-
class: NETWORK
bus: PCI
detached: 0
device: eth0
driver: via-rhine
desc: "VIA Technologies, Inc. VT6102 [Rhine-II]"
network.hwaddr: 00:0F:EA:A1:9C:85
vendorId: 1106
deviceId: 3065
subVendorId: 1458
subDeviceId: e000
pciType: 1
pcidom: 0
pcibus: 0
pcidev: 12
pcifn: 0
-
class: NETWORK
bus: PCI
detached: 0
device: eth1
driver: 8139too
desc: "Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+"
network.hwaddr: 00:08:54:17:82:C6
vendorId: 10ec
deviceId: 8139
subVendorId: 10ec
subDeviceId: 8139
pciType: 1
pcidom: 0
pcibus: 0
pcidev: 7
pcifn: 0
-
class: NETWORK
bus: PCI
detached: 0
device: dev28022
driver: 8139too
desc: "Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+"
network.hwaddr: 00:50:BF:38:99:23
vendorId: 10ec
deviceId: 8139
subVendorId: 10ec
subDeviceId: 8139
pciType: 1
pcidom: 0
pcibus: 0
pcidev: 6
pcifn: 0
---------------------------------------------------------------

kernel: 2.6.9-11.EL

PBR RULES:
*Only squid output uses link 2 (dynamic ip, cable), all other things uses link1 as default gateway.
* The squid uses "tcp_outgoing_address" parameter to determine the IP of correct interface (dev28022).




Thankz a lot.
waiting reply.

dougbourne 07-01-2008 09:21 AM

i create a simple script to try "solve" (isn't a solution, just temporary fix):

Code:

#!/bin/sh
flag=0
GW_link2=x.x.x.x
#just to got my ip:
virtua_ip=`cat /tmp/.net.issue |grep ip |cut -f2 -d :`
while ($TRUE)
do
res=`ping -c10 -s1 -I $virtua_ip www.google.com |grep transmitted |cut -f2 -d "," |tr -d " ","A-z"`
        if [ $res -eq 0 ]
        then
                if [ $flag -eq 1 ]
                then
                        continue
                fi
                ip route flush cache
                ip rule del fwmark 2
                service network restart
                route del default
                ip route add default via $GW_link2
                /etc/rc.d/firewall.backup
                echo "`date` - Freeze! Restarting!" >> /var/log/monitora.log
                flag=1
        else
                if [ $flag -eq '1' ]
                then
                        echo "`date` - Link is back. Loading rules" >> /var/log/monitora.log
                        /etc/rc.d/firewall.1
                        flag=2
                fi
        fi
done

its working for now..


All times are GMT -5. The time now is 08:51 AM.