All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Simple routing configuration
@ 2005-12-24 18:11 ` Paul Lewis
  0 siblings, 0 replies; 28+ messages in thread
From: Paul Lewis @ 2005-12-24 18:11 UTC (permalink / raw)
  To: lartc, netfilter

Hi,

I have a simple question (well, at least I think it's simple!). I have a
router, with four Ethernet cards; eth0-eth3. eth0 and eth3 are the
'external' cards, connecting to my ISPs. eth1 and eth2 are connected to my
internal networks. What I want to do is basically filter all the traffic
from one card to another, in this configuration:
	eth1 to eth3
	eth2 to eth0

The thing is, I'm not sure if this is a routing or a firewall problem, or
maybe a bit of both? I've tried setting up the routing using ip route, using
the command below, but to no avail. When I used these commands, I did not
change any of my existing firewall configuration. Here are the ip route
commands:

echo "101 ISP_1" >> /etc/iproute2/rt_tables
echo "102 ISP_2" >> /etc/iproute2/rt_tables

ip route add 192.168.4.0/22 dev eth2 src 192.168.7.253 table ISP_1
ip route add default via 192.168.100.253 table ISP_1
ip route add 192.168.0.0/22 dev eth1 src 192.168.3.253 table ISP_2
ip route add default via 192.168.20.253 table ISP_2

ip rule add from 192.168.7.253 table ISP_1
ip rule add from 192.168.3.253 table ISP_2

I also tried a simple iptables forward command, in the form of:

iptables -A FORWARD -i eth0 -o eth2 -j ACCEPT
iptables -A FORWARD -i eth2 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth3 -j ACCEPT
iptables -A FORWARD -i eth3 -o eth1 -j ACCEPT

# default policy
iptables -P FORWARD DROP

In both cases, I have set /proc/sys/net/ipv4/ip_forward to "1".

Any help would be greatly appreciated.

Many thanks,

Paul

---
Paul Lewis (paul.lewis@st-annes.ox.ac.uk)
Part II Student
Materials Science
University of Oxford




_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Networking Question
@ 2022-06-21  0:29 Ryan P. Nicholl
  2022-06-21  7:02 ` Bernd Petrovitsch
  0 siblings, 1 reply; 28+ messages in thread
From: Ryan P. Nicholl @ 2022-06-21  0:29 UTC (permalink / raw)
  To: linux-kernel

I've been unable to find any Linux API for asynchronously waiting for the TCP send buffer to drain.

The problem I have, in a nutshell, is noted in this part of the documentation:

       If fildes refers to a socket, close() shall cause the socket to
       be destroyed. If the socket is in connection-mode, and the
       SO_LINGER option is set for the socket with non-zero linger time,
       and the socket has untransmitted data, then close() shall block
       for up to the current linger interval until all data is
       transmitted.

Ok, so not good for asynchronous programming, so I could disable the SO_LINGER option, but that leaves me with another problem, namely that I *want* the socket to linger.

The behavior I want is something like, calling "close", getting EAGAIN instead of triggering TCP RST, and something like EPOLLWRITEFLUSHED to wait for the TCP send buffer to be drained. I know neither of these are possible.

Right now the only solution I can think of is to enable SO_LINGER and spawn a thread to run close in, but this might spawn a lot of threads, and doesn't support cancellation well.

Alternatively, I could call getsockopt with TCP_INFO in a loop, but this triggers a lot of wake-ups and might result in sockets hanging around a lot longer than they need to.

I want to allow linger indefinitely on close until some event happens like running out of ram or other resources, basically to intelligently do something like: "OK, we're running low on RAM/resources, time to send RST and drop the send buffer for the 5k worst behaving connections". So unfortunately even with the timeout provided by SO_LINGER, even assuming close would somehow complete in the background, this could be an issue.

Is there any way to do this properly on Linux? If not, any possibility that something like adding EPOLLWRITEFLUSHED would be a welcome addition?

Please CC me on responses.

--
Ryan P. Nicholl

^ permalink raw reply	[flat|nested] 28+ messages in thread
* networking question
@ 2013-03-14 10:55 devendra.aaru
  2013-03-14 18:11 ` Rami Rosen
  0 siblings, 1 reply; 28+ messages in thread
From: devendra.aaru @ 2013-03-14 10:55 UTC (permalink / raw)
  To: kernelnewbies

Hey all,

I have got a strange bug(?) while testing the multicasting server and client.

I have done only the INADDR_ANY bind in server and client adds its
IP_MULTICAST_IF to 224.0.0.1 ,

surprisingly i recvd pkts from the client with out joining using
IP_ADD_MEMBERSHIP.

Is that a bug? or as we listening on INADDR_ANY will make us recv all
the mcast/bcast pkts?

while if i do tx on 224.0.0.3 , the server is not able to recv the packets.

any ideas?

^ permalink raw reply	[flat|nested] 28+ messages in thread
[parent not found: <65aa6af90512241106v5e49da74jc54fa7821960ed28@mail.gmail.com>]
* Networking question
@ 2004-04-01 17:15 Tony Gogoi
  2004-04-01 18:09 ` Adam Lang
  2004-04-01 22:50 ` Glynn Clements
  0 siblings, 2 replies; 28+ messages in thread
From: Tony Gogoi @ 2004-04-01 17:15 UTC (permalink / raw)
  To: linux-admin


Hello,

Is it possible to configure a host to have 2 different IP addresses each
associated with its own unique fully qualified domain name.

To be a little more precise,
let's say I have
/etc/sysconfig/network-scripts/ifc-eth0
configured for IP address 192.168.111.4 (say)

and I also have

/etc/sysconfig/network-scripts/ifc-eth0:0
configured for IP address 192.168.111.5 (say)

However, /etc/sysconfig/network allows (or seems to allow) only a common
hostname associated with the IP addresses defined in
/etc/sysconfig/network-scripts/ifc*

But what if I want 192.168.111.4 associated with hostname "buzz" and
192.168.111.5 associated with "bumble" on a host with a single ethernet
card eth0 ???

Thanks,
Tony


Tony Gogoi

^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: Networking question
@ 2002-07-18 15:11 Bloch, Jack
  2002-07-18 15:17 ` kuznet
  0 siblings, 1 reply; 28+ messages in thread
From: Bloch, Jack @ 2002-07-18 15:11 UTC (permalink / raw)
  To: 'Maksim (Max) Krasnyanskiy', kuznet; +Cc: linux-kernel

I have tried both methods and they work. I would of course like to use the
most real-time efficient and "Kernel standard" methods. Looking into the
code code of netif_rx_ni seems to be logically the most correct way since it
will trigger do_softirq directly after the call to netif_rx.

Jack Bloch
Siemens Carrier Networks
e-mail    : jack.bloch@icn.siemens.com
phone     : (561) 923-6550


-----Original Message-----
From: Maksim (Max) Krasnyanskiy [mailto:maxk@qualcomm.com]
Sent: Wednesday, July 17, 2002 6:32 PM
To: kuznet@ms2.inr.ac.ru; Bloch, Jack
Cc: linux-kernel@vger.kernel.org
Subject: Re: Networking question



> > the priority of the softirq daemon or ensure that it is always awoken 
> when a
> > netif_rx is called?
>
>You should suppound it with local_bh_disable()/enable(), when using
>from process context.
Actually he should call netif_rx_ni() instead of netif_rx().
_ni stands for non-interrupt context.

Max

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Networking question
@ 2002-07-16 15:34 Bloch, Jack
  2002-07-16 17:00 ` kuznet
  0 siblings, 1 reply; 28+ messages in thread
From: Bloch, Jack @ 2002-07-16 15:34 UTC (permalink / raw)
  To: linux-kernel

I have an application which uses a device driver which I wrote to receive
UDP/IP messages. This driver does not use interrupts but polls to see if
messages are available. Once a message is detected I call netif_rx to pass
it up the stack. The application running from user space knows that a
message was received and does a recvfrom on my socket. On a 2.2 Kernel, this
works every time. i.e. I see a message and pass it up the stack and the
recvfrom does indeed get the message from the socket. In a 2.4 environment I
see that netif_rx is using softirq to handle the message as opposed to a BH.
There seems to be a latency introduced because of this. The ksoftirqd runs
at a low priority and my application runs at a high priority (nice value of
-10), Now it seems that the message is not waiting for me when I do a
recvfrom. I do not want to yield my program for too long since the
application is real-time intensive (i.e it must process 30 000msgs/second
which it has been able to do on a 2.2 Kernel). Is there any way to increasy
the priority of the softirq daemon or ensure that it is always awoken when a
netif_rx is called? Please CC me directly on any responses.

Jack Bloch
Siemens Carrier Networks
e-mail    : jack.bloch@icn.siemens.com
phone     : (561) 923-6550


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

end of thread, other threads:[~2022-06-21 15:43 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-24 18:11 [LARTC] Simple routing configuration Paul Lewis
2005-12-24 18:11 ` Paul Lewis
2005-12-24 18:32 ` John A. Sullivan III
2005-12-24 18:34 ` Networking question Dave Beach
2005-12-24 18:53   ` John A. Sullivan III
2005-12-24 18:56     ` /dev/rob0
2005-12-24 18:58   ` Edmundo Carmona
2005-12-24 19:02     ` Dave Beach
  -- strict thread matches above, loose matches on Subject: below --
2022-06-21  0:29 Networking Question Ryan P. Nicholl
2022-06-21  7:02 ` Bernd Petrovitsch
2022-06-21 15:43   ` Ryan P. Nicholl
2013-03-14 10:55 networking question devendra.aaru
2013-03-14 18:11 ` Rami Rosen
2013-03-15  7:19   ` devendra.aaru
     [not found] <65aa6af90512241106v5e49da74jc54fa7821960ed28@mail.gmail.com>
2005-12-24 19:09 ` Networking question Dave Beach
2005-12-24 19:17   ` Edmundo Carmona
2005-12-24 20:00     ` Dave Beach
2005-12-24 20:16       ` Edmundo Carmona
2004-04-01 17:15 Tony Gogoi
2004-04-01 18:09 ` Adam Lang
2004-04-01 18:24   ` Tony Gogoi
2004-04-01 18:39     ` Adam Lang
2004-04-01 22:50 ` Glynn Clements
2002-07-18 15:11 Bloch, Jack
2002-07-18 15:17 ` kuznet
2002-07-16 15:34 Bloch, Jack
2002-07-16 17:00 ` kuznet
2002-07-17 22:32   ` Maksim (Max) Krasnyanskiy

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.