LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-30-2008, 07:58 AM   #1
dougbourne
LQ Newbie
 
Registered: Jun 2008
Posts: 29

Rep: Reputation: 15
Question 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.
 
Old 07-01-2008, 08:21 AM   #2
dougbourne
LQ Newbie
 
Registered: Jun 2008
Posts: 29

Original Poster
Rep: Reputation: 15
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..

Last edited by dougbourne; 07-01-2008 at 08:45 AM.
 
  


Reply

Tags
centos, freez, routing



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
( advanced ) routing with iptables stormrider_may Linux - Networking 1 11-15-2007 07:27 PM
Routing tables mysteriously reloaded DJJoe Linux - Security 2 07-13-2007 03:01 AM
Routing help, a little more advanced than most howtos thebudbottle Linux - Networking 1 10-01-2004 08:14 PM
Advanced Routing Problem sirrus_linux Linux - Networking 6 09-22-2004 05:41 AM
Advanced Routing bakerv3 Linux - Networking 3 01-24-2003 06:54 AM

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

All times are GMT -5. The time now is 07:43 PM.

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