Re: A weird routing question.



On 09/28/2007 09:44 AM, Ken Sims wrote:
Hi -

On Thu, 27 Sep 2007 19:36:35 +0200, none <""testr\"@(none)"> wrote:

On a linux box 'A' which has interfaces eth0, eth1, eth2, eth3, I would
like to do a special treatment on packets incoming via eth0 and whose
source is <some-network>.

I would like these packets be unconditionaly redirected unmodified for
output via interface eth1.

That is:
- even if they were targeted (destination IP) at my box 'A', they will
be re-emitted through eth1.
- even if they would have been forwarded through eth2 or eth3, they
will be re-emitted through eth1 too.

If they would be forwarded anyway, advanced routing can be used to
force them out a specific interface.

For packets whose destination is 'A', I think you would need to do
something with netfilter to get the packets on to the forwarding
chain, but I don't know how without changing the destination IP
address.

If forwarding is enable, which indeed should be, on this machine
acting/imitating as router, I on Redhat like machines shall create an
alias eth1:0, whereas on Debian and, or Ubuntu I shall use
iproute/iprute2 as follows:

# ip addr add dev eth1 local net.wo.rkX.host/ne.tm.as.kX

I OTOH, am curious to know, how netfilter/iptables can forward packets?
Do we have kind of some FORWARD target for PREROUTING chain?

--
Dr Balwinder S "bsd" Dheeman Registered Linux User: #229709
Anu'z Linux@HOME Machines: #168573, 170593, 259192
Chandigarh, UT, 160062, India Gentoo, Fedora, Debian/FreeBSD/XP
Home: http://cto.homelinux.net/~bsd/ Visit: http://counter.li.org/
.



Relevant Pages

  • Re: Port forwarding versus permit
    ... :SMTP port 25 on TCP being forwarded to an e-mail server on the inside LAN. ... :forwarding take place? ... If the packets arrive with a destination IP and port for which there ... happens to be an active translation to an inside machine (possibly ...
    (comp.dcom.sys.cisco)
  • Re: IP forwarding
    ... forwarding and also turned on IP_ADVANCED_ROUTER in config options. ... netmask is 255.255.255.0 for both.I am trigerring traffic on eth1. ... I don't see the packets being forwarded. ... An eth1 box needs a gateway statement in its route table so it knows ...
    (comp.os.linux.networking)
  • Re: [fw-wiz] FreeBSD 4.9 ipfw natd -- Port Forwarding
    ... I tried the ipfw fwd command as well with no success. ... my freeBSD server and my internal web server was dropping them because they ... > the packets are being forwarded to a RFC 1918-addressed jail within the ... > difference between this and forwarding to an external server, ...
    (Firewall-Wizards)
  • Re: What are these services ?
    ... > non-SYN) packets destined <1024. ... When I try forwarding a privileged port, ... The router doesn't have storage. ...
    (comp.os.linux.security)
  • Re: Network performance in a dual CPU system
    ... M>>forwarding ... M>>any packet filters or other additional processing of forwarded packets? ... Virtual interface disc0 is our ... packet if it is routed to interface w/o IFF_DRV_RUNNING flag. ...
    (freebsd-net)