All of lore.kernel.org
 help / color / mirror / Atom feed
* packets to local addresses
@ 2007-04-06 12:22 MKS
  2007-04-06 16:12 ` Martijn Lievaart
  0 siblings, 1 reply; 11+ messages in thread
From: MKS @ 2007-04-06 12:22 UTC (permalink / raw)
  To: netfilter

Hello list

I have a scenario the a computer has 2 PPP connections, where the
computer is the ppp client.

$ifconfig

ppp0   inet  10.0.0.1 p-t-p  192.168.1.1 mask 255.255.255.255

ppp1 inet  10.0.1.1 p-t-p 192.168.1.1 mask  255.255.255.255

for testing purpuses I want packets from ppp0 to ppp1 to actually go
over the physical connection

e.g.

ping  10.0.0.1 -I ppp1 should send the packet over the ppp1 (and out
underlyging physical interface eth0) and it should arrive on the ppp0
interface. (routing is taken care of at the ppp server)

This proably isn't a netfilter issue(?) but I was hoping that some
networking guru would have a solution for me;)

route
Destionation     Gateway      Genmask       iface
  192.168.1.1              *            255.255.255.255  ppp0
 192.168.1.1              *            255.255.255.255   ppp1
0.0.0.0                      *             0.0.0.0                  ppp0
0.0.0.0                      *              0.0.0.0                  ppp1

regards

Mks


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-06 12:22 packets to local addresses MKS
@ 2007-04-06 16:12 ` Martijn Lievaart
  2007-04-07 14:13   ` MKS
  0 siblings, 1 reply; 11+ messages in thread
From: Martijn Lievaart @ 2007-04-06 16:12 UTC (permalink / raw)
  To: MKS; +Cc: netfilter

MKS wrote:
> Hello list
>
> I have a scenario the a computer has 2 PPP connections, where the
> computer is the ppp client.
>
> $ifconfig
>
> ppp0   inet  10.0.0.1 p-t-p  192.168.1.1 mask 255.255.255.255
>
> ppp1 inet  10.0.1.1 p-t-p 192.168.1.1 mask  255.255.255.255
>
> for testing purpuses I want packets from ppp0 to ppp1 to actually go
> over the physical connection
>
> e.g.
>
> ping  10.0.0.1 -I ppp1 should send the packet over the ppp1 (and out
> underlyging physical interface eth0) and it should arrive on the ppp0
> interface. (routing is taken care of at the ppp server)

The -I flag only changes the source address of the packets, not the 
routing. And as the packet is destined for the machine itself, it goes 
over the loopback interface. Maybe adding the -r flag does what you 
want, but I doubt it.

Hping2 probably can do this:

       -I --interface interface name
              By default on linux and BSD systems hping2 uses default  
routing
              interface.   In  other systems or when there is no default 
route
              hping2 uses the first non-loopback interface.  However  
you  are
              able  to  force  hping2 to use the interface you need 
using this
              option. Note: you don't need to  specify  the  whole  
name,  for
              example  -I  et will match eth0 ethernet0 myet1 et cetera. 
If no
              interfaces match hping2 will try to use lo.

HTH,
M4



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-06 16:12 ` Martijn Lievaart
@ 2007-04-07 14:13   ` MKS
  2007-04-07 15:45     ` Martijn Lievaart
  0 siblings, 1 reply; 11+ messages in thread
From: MKS @ 2007-04-07 14:13 UTC (permalink / raw)
  To: netfilter

On 4/6/07, Martijn Lievaart <m@rtij.nl> wrote:
> MKS wrote:
> > Hello list
> >
> > I have a scenario the a computer has 2 PPP connections, where the
> > computer is the ppp client.
> >
> > $ifconfig
> >
> > ppp0   inet  10.0.0.1 p-t-p  192.168.1.1 mask 255.255.255.255
> >
> > ppp1 inet  10.0.1.1 p-t-p 192.168.1.1 mask  255.255.255.255
> >
> > for testing purpuses I want packets from ppp0 to ppp1 to actually go
> > over the physical connection
> >
> > e.g.
> >
> > ping  10.0.0.1 -I ppp1 should send the packet over the ppp1 (and out
> > underlyging physical interface eth0) and it should arrive on the ppp0
> > interface. (routing is taken care of at the ppp server)
>
> The -I flag only changes the source address of the packets, not the
> routing. And as the packet is destined for the machine itself, it goes
> over the loopback interface.

What is the best way to change this behaviour, that is force "general"
packets out a specific interface. iptables route target???

Thanks
MKS


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-07 14:13   ` MKS
@ 2007-04-07 15:45     ` Martijn Lievaart
  2007-04-07 18:40       ` Jan Engelhardt
  0 siblings, 1 reply; 11+ messages in thread
From: Martijn Lievaart @ 2007-04-07 15:45 UTC (permalink / raw)
  To: MKS; +Cc: netfilter

MKS wrote:
> What is the best way to change this behaviour, that is force "general"
> packets out a specific interface. iptables route target???

Dunno. Maybe the ROUTE target can be of assistence. As I said earlier, 
hping2 probably can do this.

M4



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-07 15:45     ` Martijn Lievaart
@ 2007-04-07 18:40       ` Jan Engelhardt
  2007-04-07 19:27         ` Pascal Hambourg
  2007-04-07 21:39         ` Martijn Lievaart
  0 siblings, 2 replies; 11+ messages in thread
From: Jan Engelhardt @ 2007-04-07 18:40 UTC (permalink / raw)
  To: Martijn Lievaart; +Cc: netfilter, MKS


On Apr 7 2007 17:45, Martijn Lievaart wrote:
> MKS wrote:
>> What is the best way to change this behaviour, that is force "general"
>> packets out a specific interface. iptables route target???
>
> Dunno. Maybe the ROUTE target can be of assistence. As I said earlier, hping2
> probably can do this.

Use MARK and iproute2.

Jan
-- 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-07 18:40       ` Jan Engelhardt
@ 2007-04-07 19:27         ` Pascal Hambourg
  2007-04-07 21:39         ` Martijn Lievaart
  1 sibling, 0 replies; 11+ messages in thread
From: Pascal Hambourg @ 2007-04-07 19:27 UTC (permalink / raw)
  To: netfilter

Hello,

Jan Engelhardt a écrit :
>>MKS wrote:
>>
>>>What is the best way to change this behaviour, that is force "general"
>>>packets out a specific interface. iptables route target???
> 
> Use MARK and iproute2.

This won't work for local addresses. The local routing table is looked 
up first in the routing process, before any custom ip rule can be 
examined. So MARK and iproute2 have no effect on the routing of local 
and broadcast addresses.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-07 18:40       ` Jan Engelhardt
  2007-04-07 19:27         ` Pascal Hambourg
@ 2007-04-07 21:39         ` Martijn Lievaart
  2007-04-10 11:52           ` MKS
  1 sibling, 1 reply; 11+ messages in thread
From: Martijn Lievaart @ 2007-04-07 21:39 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: netfilter, MKS

Jan Engelhardt wrote:
> On Apr 7 2007 17:45, Martijn Lievaart wrote:
>   
>> MKS wrote:
>>     
>>> What is the best way to change this behaviour, that is force "general"
>>> packets out a specific interface. iptables route target???
>>>       
>> Dunno. Maybe the ROUTE target can be of assistence. As I said earlier, hping2
>> probably can do this.
>>     
>
> Use MARK and iproute2.
>   

Are you sure? I thought you couldn't overrule the local table.

M4



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-07 21:39         ` Martijn Lievaart
@ 2007-04-10 11:52           ` MKS
  2007-04-10 15:21             ` Jan Engelhardt
  0 siblings, 1 reply; 11+ messages in thread
From: MKS @ 2007-04-10 11:52 UTC (permalink / raw)
  To: Martijn Lievaart; +Cc: netfilter

On 4/7/07, Martijn Lievaart <m@rtij.nl> wrote:
> Jan Engelhardt wrote:
> > On Apr 7 2007 17:45, Martijn Lievaart wrote:
> >
> >> MKS wrote:
> >>
> >>> What is the best way to change this behaviour, that is force "general"
> >>> packets out a specific interface. iptables route target???
> >>>
> >> Dunno. Maybe the ROUTE target can be of assistence. As I said earlier, hping2
> >> probably can do this.
> >>
> >
> > Use MARK and iproute2.
> >
>
> Are you sure? I thought you couldn't overrule the local table.

It's not possible to override the local table nor bypass or delete from it.

When I use hping -I ppp0 and ping to 10.0.1.1 (ppp1) then I don't get
any response and I can see that the packet never leaves the system
(tcpdump -i ppp0) and that it never arrives on the NAS (using debug on
the NAS)

Does someone know a trick to override the local routing table? or does
that require hacking the kernel?

Regards MKS


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-10 11:52           ` MKS
@ 2007-04-10 15:21             ` Jan Engelhardt
  2007-04-10 15:53               ` MKS
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Engelhardt @ 2007-04-10 15:21 UTC (permalink / raw)
  To: MKS; +Cc: netfilter


On Apr 10 2007 11:52, MKS wrote:
>
> It's not possible to override the local table nor bypass or delete from it.
>
> When I use hping -I ppp0 and ping to 10.0.1.1 (ppp1) then I don't get
> any response and I can see that the packet never leaves the system
> (tcpdump -i ppp0) and that it never arrives on the NAS (using debug on
> the NAS)
>
> Does someone know a trick to override the local routing table? or does
> that require hacking the kernel?

What exactly are you trying to achieve?
To simply test transmission, `ping -I interface -bf 255.255.255.255`
does the job.


Jan
-- 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-10 15:21             ` Jan Engelhardt
@ 2007-04-10 15:53               ` MKS
  2007-04-10 16:20                 ` Jan Engelhardt
  0 siblings, 1 reply; 11+ messages in thread
From: MKS @ 2007-04-10 15:53 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: netfilter

On 4/10/07, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
>
> On Apr 10 2007 11:52, MKS wrote:
> >
> > It's not possible to override the local table nor bypass or delete from it.
> >
> > When I use hping -I ppp0 and ping to 10.0.1.1 (ppp1) then I don't get
> > any response and I can see that the packet never leaves the system
> > (tcpdump -i ppp0) and that it never arrives on the NAS (using debug on
> > the NAS)
> >
> > Does someone know a trick to override the local routing table? or does
> > that require hacking the kernel?
>
> What exactly are you trying to achieve?
> To simply test transmission, `ping -I interface -bf 255.255.255.255`
> does the job.

I want to generate load on the NAS by making a traffic matrix over n
ppp connections.
e.g. ppp0 will send traffic to ppp1-pppN, etc.

Regards
MKS


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: packets to local addresses
  2007-04-10 15:53               ` MKS
@ 2007-04-10 16:20                 ` Jan Engelhardt
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Engelhardt @ 2007-04-10 16:20 UTC (permalink / raw)
  To: MKS; +Cc: netfilter


On Apr 10 2007 15:53, MKS wrote:
>> 
>> What exactly are you trying to achieve?
>> To simply test transmission, `ping -I interface -bf 255.255.255.255`
>> does the job.
>
> I want to generate load on the NAS by making a traffic matrix over n
> ppp connections.
> e.g. ppp0 will send traffic to ppp1-pppN, etc.

I don't think that's what ppp is for. Use bonding or bridging perhaps.


Jan
-- 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-04-10 16:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-06 12:22 packets to local addresses MKS
2007-04-06 16:12 ` Martijn Lievaart
2007-04-07 14:13   ` MKS
2007-04-07 15:45     ` Martijn Lievaart
2007-04-07 18:40       ` Jan Engelhardt
2007-04-07 19:27         ` Pascal Hambourg
2007-04-07 21:39         ` Martijn Lievaart
2007-04-10 11:52           ` MKS
2007-04-10 15:21             ` Jan Engelhardt
2007-04-10 15:53               ` MKS
2007-04-10 16:20                 ` Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.