Re: A weird routing question.



Robert Harris <robert.f.harris@xxxxxxxxxxxxxxxx> writes:

none wrote:
Hi all,


Generally speaking, in an IP network, any IP packet which reach a node
(workstation, gateway, router...), and whichever the incoming interface,
will either be caught and absorbed by this node if it is the intended
recipient, or redirected for output (IP forwarding) through [another]
interface in respect to the current routing policy.

But I have a weird goal to achieve:

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 silly, since then they would still have exactly the same packet
headers and address that they had coming in-- ie your box A address on the
wrong network. It, all that can happen is that they get thrown away since
the address cannot be found.

You seem to be confused as to what an ip packet is ( or maybe I am). It has
a header, saying where it is going and where it came from. It has contents.
YOu are asking like-- I want all letters coming to my house to be thrown
back into the post box immediately in the same envelope they came in. In
the best circumstance they will get delived right back to you again. In the
worst they will get thrown away. In no case does this accomplish anything
useful Perhaps you should tell us what you want to accomplish and we might
be able to tell you how to do not.

That is:
- even if they were targeted (destination IP) at my box 'A', they will
be re-emitted through eth1.

And what is supposed to happen to them then?

- even if they would have been forwarded through eth2 or eth3, they
will be re-emitted through eth1 too.

No idea what this means.




Any idea to help me reach this goal?


Sincerely,
Le Testeur
You need to read "raw" packets at eth0 and write them to eth1.

"man packet" will get you started. There is also a library "libpcap"
that is used by tcpdump which you may find useful.

Robert
.



Relevant Pages

  • Re: VLANs and routing
    ... machine1 shouldn't have assigned IP address, ... to transmit a packet, it needs to put a source IP address into the packet ... - which virtually always comes from the interface. ... destination network should be collected by using ARP. ...
    (freebsd-net)
  • [TOOL] IPTraf, IP Network Monitoring Software
    ... IPTraf is a console-based network statistics utility for Linux. ... LAN station packet and byte counts. ... Includes TCP flag information, packet and byte counts, ... * General and detailed interface statistics showing IP, TCP, UDP, ICMP, ...
    (Securiteam)
  • Intermittent loss of connectivity on QFE card
    ... I've got a Sun E450, running Solaris 7, with an hme card and a qfe ... The hme interface points to one private network (e.g. ... Using a packet sniffer, I see some more odd behavior. ...
    (comp.unix.solaris)
  • Re: how to shape incoming traffic on specific port?
    ... >> What sort of set up is this? ... > various combinations for simulating another network. ... My assumption was that you would be recieving a packet on one ... interface and sending it to another interface. ...
    (Debian-User)
  • RE: Intrusion Prevention requirements document
    ... The tools consider one interface as "client" and other ... Packet 1 is first sent out on client interface. ... > my previous company was Blade Software where I developed IDS Informer ... Up to 75% of cyber attacks are launched on shopping carts, ...
    (Pen-Test)