LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: finding/calculating network using iproute2 tools

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx, osvaldo@xxxxxxxxxxxx
Subject: Re: finding/calculating network using iproute2 tools
From: Joseph Mack <mack.joseph@xxxxxxx>
Date: Mon, 03 Jun 2002 11:31:42 -0400
Osvaldo Mundim Junior wrote:
> 
> What you really want to do?  I didn't understand it. Must you get an IP for
> what?

An example iptables rule on the realserver

iptables -A OUTPUT -t mangle -p tcp -s ${RIP}/32 -d ! ${RIP_NETWORK}/${NETMASK} 
\
  --sport auth -j MARK --set-mark 1

which says to mark any packets from RIP:auth going to IPs outside the 
RIP_NETWORK
(where RIP_NETWORK/RIP_NETMASK is 192.168.1.0/24).

I need to be able to recover the string "192.168.1.0/24" from some command I 
can run
on the realserver. Since I will be putting IPs onto the machines with iproute2
tools with a  command like

ip addr add dev eth0 192.168.1.1/24 brd +

it would be nice if I could tell that the $NETWORK is 192.168.1.0 directly.
Presumable I could write a routine that would calculate the network by masking
the IP, but surely the tools should be able to tell me directly?

Thanks 
Joe

-- 
Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
contractor to the National Environmental Supercomputer Center, 
mailto:mack.joseph@xxxxxxx ph# 919-541-0007, RTP, NC, USA


<Prev in Thread] Current Thread [Next in Thread>