Lines 139-144
Link Here
|
139 |
then |
139 |
then |
140 |
echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter |
140 |
echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter |
141 |
fi |
141 |
fi |
|
|
142 |
|
143 |
if [ -f /etc/conf.d/net.${IFACE}.routes ] |
144 |
then |
145 |
local OK=1 |
146 |
|
147 |
if [ -n "${inet6_IFACE}" ] |
148 |
then |
149 |
local CNT="$(eval /bin/egrep -e \"^[0-9a-fA-F\:\/]+\" /etc/conf.d/net.${IFACE}.routes \| /bin/wc -l \| awk \'\{ print \$1 \}\')" |
150 |
local MSG="Setting ${CNT} static route" |
151 |
|
152 |
if [ ${CNT} -gt 1 ] |
153 |
then |
154 |
MSG="${MSG}s" |
155 |
fi |
156 |
|
157 |
ebegin " ${MSG}" |
158 |
|
159 |
egrep -e "^[0-9a-fA-F\:\/]+" /etc/conf.d/net.${IFACE}.routes | |
160 |
(while read ROUTE ; do |
161 |
/sbin/route -A inet6 add ${ROUTE} dev ${IFACE} |
162 |
if [ $? -ne 0 ] |
163 |
then |
164 |
OK=0 |
165 |
fi |
166 |
done) |
167 |
else |
168 |
local CNT="$(eval /bin/egrep -e \"^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+.*\" /etc/conf.d/net.${IFACE}.routes \| /bin/wc -l \| awk \'\{ print \$1 \}\')" |
169 |
local MSG="Setting ${CNT} static route" |
170 |
|
171 |
if [ ${CNT} -gt 1 ] |
172 |
then |
173 |
MSG="${MSG}s" |
174 |
fi |
175 |
|
176 |
ebegin " ${MSG}" |
177 |
|
178 |
egrep -e "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+.*" /etc/conf.d/net.${IFACE}.routes | |
179 |
(while read ROUTE ; do |
180 |
/sbin/route add ${ROUTE} dev ${IFACE} |
181 |
if [ $? -ne 0 ] |
182 |
then |
183 |
OK=0 |
184 |
fi |
185 |
done) |
186 |
fi |
187 |
|
188 |
if [ ${OK} -eq 1 ] |
189 |
then |
190 |
eend 0 |
191 |
else |
192 |
eend "Failed to set some of the static routes" |
193 |
fi |
194 |
fi |
142 |
} |
195 |
} |
143 |
|
196 |
|
144 |
iface_stop() { |
197 |
iface_stop() { |
Lines 198-203
Link Here
|
198 |
/sbin/vconfig add ${IFACE} ${vlan} >/dev/null |
251 |
/sbin/vconfig add ${IFACE} ${vlan} >/dev/null |
199 |
iface_start ${IFACE}.${vlan} |
252 |
iface_start ${IFACE}.${vlan} |
200 |
done |
253 |
done |
|
|
254 |
|
255 |
# set static ARP table entries |
256 |
if [ -f /etc/ethers ] |
257 |
then |
258 |
local CNT="$(eval /bin/egrep -e "^\(\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\)\|\([A-Z0-9\-\.]+\)\)[[:space:]]+\([0-9A-F]\{2\}:\)\{5\}[0-9A-F]\{2\}" /etc/ethers \| /bin/wc -l \| awk \'\{ print \$1 \}\')" |
259 |
local MSG="Setting ${CNT} static ARP table entr" |
260 |
|
261 |
if [ ${CNT} -gt 1 ] |
262 |
then |
263 |
MSG="${MSG}ies" |
264 |
else |
265 |
MSG="${MSG}y" |
266 |
fi |
267 |
|
268 |
ebegin " ${MSG}" |
269 |
/sbin/arp -f 2>/dev/null >/dev/null |
270 |
|
271 |
if [ $? -ne 0 ] |
272 |
then |
273 |
eend $? "Failed to set ARP table entries" |
274 |
else |
275 |
eend 0 |
276 |
fi |
277 |
fi |
201 |
} |
278 |
} |
202 |
|
279 |
|
203 |
stop () { |
280 |
stop () { |