2002-02-20 04:59:22

by Sandeep Gopal Nijsure

[permalink] [raw]
Subject: About net part of the kernel

Hi,

I want to make, say, a machine 10.0.0.5 accept an IP packet with the
destination address of 10.0.0.2. I hope I can do this by changing a bit of
kernel networking code, where it's decided whether to accept an IP packet
as a local packet.. I could not locate the code.. could anybody tell me
where exactly the decision process take place?

Thanks a lot..
Sandeep



2002-02-20 05:08:02

by Ben Collins

[permalink] [raw]
Subject: Re: About net part of the kernel

On Tue, Feb 19, 2002 at 10:58:53PM -0600, Sandeep Gopal Nijsure wrote:
> Hi,
>
> I want to make, say, a machine 10.0.0.5 accept an IP packet with the
> destination address of 10.0.0.2. I hope I can do this by changing a bit of
> kernel networking code, where it's decided whether to accept an IP packet
> as a local packet.. I could not locate the code.. could anybody tell me
> where exactly the decision process take place?

You could just use device aliasing:

ifconfig eth0 10.0.0.5
ifconfig eth0:1 10.0.0.2

Either that, or if you simply want to sniff network packets, look into
turning on promiscuous mode (as tcpdump does).

--
.----------=======-=-======-=========-----------=====------------=-=-----.
/ Ben Collins -- Debian GNU/Linux -- WatchGuard.com \
` [email protected] -- [email protected] '
`---=========------=======-------------=-=-----=-===-======-------=--=---'

2002-02-20 05:10:53

by Alex Song

[permalink] [raw]
Subject: RE: About net part of the kernel

you don't have to change and part of the kernel, you can do what you want
with ipchains (2.2 kernels) or iptables (2.4 kernels).

cheers,

alex

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Sandeep Gopal
> Nijsure
> Sent: Wednesday, 20 February 2002 2:59 PM
> To: [email protected]
> Subject: About net part of the kernel
>
>
> Hi,
>
> I want to make, say, a machine 10.0.0.5 accept an IP packet with the
> destination address of 10.0.0.2. I hope I can do this by changing a bit of
> kernel networking code, where it's decided whether to accept an IP packet
> as a local packet.. I could not locate the code.. could anybody tell me
> where exactly the decision process take place?
>
> Thanks a lot..
> Sandeep
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2002-02-20 05:14:03

by Alex Song

[permalink] [raw]
Subject: RE: About net part of the kernel

ignore what i said before, i misread the question.

cheers,

alex

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Alex Song
> Sent: Wednesday, 20 February 2002 3:10 PM
> To: Sandeep Gopal Nijsure; [email protected]
> Subject: RE: About net part of the kernel
>
>
> you don't have to change and part of the kernel, you can do what you want
> with ipchains (2.2 kernels) or iptables (2.4 kernels).
>
> cheers,
>
> alex
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]]On Behalf Of Sandeep Gopal
> > Nijsure
> > Sent: Wednesday, 20 February 2002 2:59 PM
> > To: [email protected]
> > Subject: About net part of the kernel
> >
> >
> > Hi,
> >
> > I want to make, say, a machine 10.0.0.5 accept an IP packet with the
> > destination address of 10.0.0.2. I hope I can do this by
> changing a bit of
> > kernel networking code, where it's decided whether to accept an
> IP packet
> > as a local packet.. I could not locate the code.. could anybody tell me
> > where exactly the decision process take place?
> >
> > Thanks a lot..
> > Sandeep
> >
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>