Hello, I''m using shorewall-4.5.16 with centos5. The dhclient stores the lease information on the /var/lib/dhclient/dhclient-<DEVICE>.leases file. The /var/lib/shorewall/firewall script has the function detect_dynamic_gateway that detects the gateway based on the leases file. The code in the function is: detect_dynamic_gateway() { # $1 = interface local interface interface=$1 local GATEWAYS GATEWAYS local gateway gateway=$(run_findgw_exit $1); if [ -z "$gateway" ]; then gateway=$( find_peer $($IP addr list $interface ) ) fi if [ -z "$gateway" -a -f ${VARLIB}/dhcpcd/dhcpcd-${1}.info ]; then eval $(grep ^GATEWAYS= ${VARLIB}/dhcpcd/dhcpcd-${1}.info 2> /dev/null) [ -n "$GATEWAYS" ] && GATEWAYS=${GATEWAYS%,*} && gateway=$GATEWAYS fi if [ -z "$gateway" -a -f ${VARLIB}/dhcp/dhclient-${0}.lease ]; then gateway=$(grep ''option routers'' ${VARLIB}/dhcp/dhclient-${1}.lease | tail -n 1 | while read j1 j2 gateway; do echo $gateway ; return 0; done) fi [ -n "$gateway" ] && echo $gateway } How do you have the lease file in there? Is it only for some linux distro, say ubuntu? In centos is hardcoded to another directory: root localhost /etc/sysconfig/network-scripts # grep DHCLIENTARGS ifup-eth DHCLIENTARGS="${DHCLIENTARGS} ${ONESHOT} -q ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid" The attached patch correct this issue. Can you please import it? Thanks, Nuno Fernandes ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
On 10/10/2013 4:47 AM, Nuno Fernandes wrote:> Hello, > > > > I''m using shorewall-4.5.16 with centos5. The dhclient stores the lease > information on the /var/lib/dhclient/dhclient-<DEVICE>.leases file. > > > > The /var/lib/shorewall/firewall script has the function > detect_dynamic_gateway that detects the gateway based on the leases > file. The code in the function is: > > > > detect_dynamic_gateway() { # $1 = interface > > local interface > > interface=$1 > > local GATEWAYS > > GATEWAYS> > local gateway > > > > gateway=$(run_findgw_exit $1); >The entire purpose of the findgw extension script is to allow for different locations and filenames for these files. -Tom -- Tom Eastep \ When I die, I want to go like my Grandfather who Shoreline, \ died peacefully in his sleep. Not screaming like Washington, USA \ all of the passengers in his car http://shorewall.net \________________________________________________ ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
On 10/10/2013 7:47 AM, Nuno Fernandes wrote:> Hello, > > I''m using shorewall-4.5.16 with centos5. The dhclient stores the lease > information on the /var/lib/dhclient/dhclient-<DEVICE>.leases file. >Take a look at: http://www.shorewall.net/pub/shorewall/contrib/findgw/ ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
On Tuesday 15 October 2013 14:18:00 Thomas Harold wrote:> On 10/10/2013 7:47 AM, Nuno Fernandes wrote: > > Hello, > > > > I''m using shorewall-4.5.16 with centos5. The dhclient stores the lease > > information on the /var/lib/dhclient/dhclient-<DEVICE>.leases file. > > Take a look at: > > http://www.shorewall.net/pub/shorewall/contrib/findgw/Yes.. i''ve found that. Will do some tests later on. Thanks, Nuno Fernandes ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk