Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #4836

Re: Forwarding a TCP connection

From Tauno Voipio <tauno.voipio@notused.fi.invalid>
Newsgroups comp.os.linux.networking
Subject Re: Forwarding a TCP connection
Date 2021-03-16 11:16 +0200
Organization A noiseless patient Spider
Message-ID <s2pt16$384$1@dont-email.me> (permalink)
References <s2lqd7$1ljv$1@gioia.aioe.org> <op.0z9k5pu0a3w0dxdave@hodgins.homeip.net> <slrns4v7h8.3f3.dyrmak@quelite.terre> <3l35ih-6mu.ln1@Telcontar.valinor> <slrns4vqkn.2ptb.grahn+nntp@frailea.sa.invalid>

Show all headers | View raw


On 16.3.2021 01:15 AM, Jorgen Grahn wrote:
> On Mon, 2021-03-15, Carlos E.R. wrote:
>> On 15/03/2021 18.49, dyrmak wrote:
>>> En 33 lignes David W. Hodgins a écrit
>>> dans news:op.0z9k5pu0a3w0dxdave@hodgins.homeip.net
>>>    le dimanche, 14 mars 2021 à 22:40:27 :
>>>
>>>>> 	Can this be done?
>>>>
>>>> It's called network address translation.
>>>>
>>>> iptables -t nat -A PREROUTING -p tcp --dport 2222 \
>>>>             -j DNAT --to-destination 1.2.3.4:8888
>>>>
>>>> Do you not control the router that's sending the packet to B in the first place?
>>>>
>>>> On my lan, the router forwards packets for some ports to one lan computer, and
>>>> packets for some other packets to another one.
>>>>
>>>> Or do you intend to have B do additional things with the packet, such as logging.
>>
>>>>
>>>    It seems to me that somehow A & B are directly connected to each
>>>    other through and eth cable or something, in a LAN all machines go
>>>    through the router and the router can send packets to another machine
>>>    with a set of simple rules, for this, checking out the router, if
>>>    any, might be a good idea.
>>
>> Home routers are not actually "routing" the LAN. The LAN is connected to
>> a switch in the "router" box. The router part of the "router" does not
>> intervene in that traffic.
> 
> And meanwhile, boxes called "managed switches" seem to be, amongst
> other things, routers.  Then if you pay a lot more, they are called
> "routers" again. The terminology is terribly confused.
> 
> /Jorgen


A proper managed switch works based on the connectors the traffic
comes in or goes out, and on the Ethernet MAC addresses. The connectors
are called ports in switch parlance, and they must not be confused with
the TCP and UDP ports, which are software-defined mailboxes in protocol.

The managed switches may group ports in groups called VLANs, virtual
LANs. In principle, the ports in different VLANs do not connect to
each other. However, a port may be designated a trunk port carrying
the traffic of several VLANs at the same time. Even there the different
VLANs are kept separate by a special identification tag in the Ethernet
header.

Some operating systems can handle tagged traffic. In Linux, the VLANs
are seen as separate interfaces, marked with a dot and the VLAN number,
e.g. eth0.3 for VLAN id 3 on eth0. The home routers seem to use this
to provide several separate networks for external and internal nets,
using only one Ethernet interface on the processor.

There are bastard cross-overs between managed switches and routers,
peeking into the IP traffic, but otherwise behaving like switches.

A pure switch does not care about the payload protocols riding on
the switched Ethernet.

-- 

-TV

Back to comp.os.linux.networking | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Forwarding a TCP connection John Smith <12345@whatismyemailaddress.xyz> - 2021-03-14 20:07 +0000
  Re: Forwarding a TCP connection "Carlos E.R." <robin_listas@es.invalid> - 2021-03-14 22:41 +0100
    Re: Forwarding a TCP connection Richard Kettlewell <invalid@invalid.invalid> - 2021-03-14 22:02 +0000
      Re: Forwarding a TCP connection "Carlos E.R." <robin_listas@es.invalid> - 2021-03-14 23:26 +0100
        Re: Forwarding a TCP connection Richard Kettlewell <invalid@invalid.invalid> - 2021-03-14 22:46 +0000
      Re: Forwarding a TCP connection Pascal Hambourg <pascal@plouf.fr.eu.org> - 2021-03-15 09:42 +0100
  Re: Forwarding a TCP connection Jim Jackson <jj@franjam.org.uk> - 2021-03-14 22:03 +0000
  Re: Forwarding a TCP connection "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2021-03-14 17:40 -0400
    Re: Forwarding a TCP connection John Smith <12345@whatismyemailaddress.xyz> - 2021-03-14 23:23 +0000
    Re: Forwarding a TCP connection dyrmak <dyrmak@quelite.terre.invalid> - 2021-03-15 17:49 +0000
      Re: Forwarding a TCP connection Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2021-03-15 20:14 +0200
      Re: Forwarding a TCP connection "Carlos E.R." <robin_listas@es.invalid> - 2021-03-15 23:28 +0100
        Re: Forwarding a TCP connection Jorgen Grahn <grahn+nntp@snipabacken.se> - 2021-03-15 23:15 +0000
          Re: Forwarding a TCP connection dyrmak <dyrmak@orange.fr.invalid> - 2021-03-16 07:59 +0000
          Re: Forwarding a TCP connection Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2021-03-16 11:16 +0200
            Re: Forwarding a TCP connection Jim Jackson <jj@franjam.org.uk> - 2021-03-16 14:53 +0000
          Re: Forwarding a TCP connection "Carlos E.R." <robin_listas@es.invalid> - 2021-03-16 03:21 +0100
          Re: Forwarding a TCP connection Jim Jackson <jj@franjam.org.uk> - 2021-03-16 14:49 +0000
            Re: Forwarding a TCP connection Johann Beretta <beretta@nun-ya-bizness.com> - 2021-05-28 13:19 -0700
              Re: Forwarding a TCP connection Grant Taylor <gtaylor@tnetconsulting.net> - 2021-05-28 16:20 -0600
        Re: Forwarding a TCP connection Johann Beretta <beretta@nun-ya-bizness.com> - 2021-05-28 13:15 -0700
          Re: Forwarding a TCP connection Grant Taylor <gtaylor@tnetconsulting.net> - 2021-05-28 16:23 -0600
            Re: Forwarding a TCP connection Marc Haber <mh+usenetspam1118@zugschl.us> - 2021-05-29 18:42 +0200
              Re: Forwarding a TCP connection Grant Taylor <gtaylor@tnetconsulting.net> - 2021-05-29 19:29 -0600
                Re: Forwarding a TCP connection Marc Haber <mh+usenetspam1118@zugschl.us> - 2021-05-30 12:08 +0200
                Re: Forwarding a TCP connection Grant Taylor <gtaylor@tnetconsulting.net> - 2021-05-31 22:43 -0600
                Re: Forwarding a TCP connection Marc Haber <mh+usenetspam1118@zugschl.us> - 2021-06-01 08:51 +0200
    Re: Forwarding a TCP connection Johann Beretta <beretta@nun-ya-bizness.com> - 2021-03-24 19:30 -0700
      Re: Forwarding a TCP connection Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2021-03-25 16:35 +0200
        Re: Forwarding a TCP connection Pascal Hambourg <pascal@plouf.fr.eu.org> - 2021-03-25 20:03 +0100
          Re: Forwarding a TCP connection Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2021-03-25 21:34 +0200
            Re: Forwarding a TCP connection Pascal Hambourg <pascal@plouf.fr.eu.org> - 2021-03-25 21:54 +0100
            Re: Forwarding a TCP connection Johann Beretta <beretta@nun-ya-bizness.com> - 2021-03-29 13:45 -0700
        Re: Forwarding a TCP connection Johann Beretta <beretta@nun-ya-bizness.com> - 2021-03-29 13:43 -0700
          Re: Forwarding a TCP connection Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2021-03-30 20:26 +0300
            Re: Forwarding a TCP connection Johann Beretta <beretta@nun-ya-bizness.com> - 2021-03-30 22:49 -0700
              Re: Forwarding a TCP connection Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2021-03-31 16:29 +0000
  Re: Forwarding a TCP connection John Smith <12345@whatismyemailaddress.xyz> - 2021-03-14 23:13 +0000
    Re: Forwarding a TCP connection Jorgen Grahn <grahn+nntp@snipabacken.se> - 2021-03-15 06:59 +0000
    Re: Forwarding a TCP connection Pascal Hambourg <pascal@plouf.fr.eu.org> - 2021-03-15 09:48 +0100
      Re: Forwarding a TCP connection John Smith <12345@whatismyemailaddress.xyz> - 2021-03-15 13:44 +0000
        Re: Forwarding a TCP connection Pascal Hambourg <pascal@plouf.fr.eu.org> - 2021-03-15 20:49 +0100
          Re: Forwarding a TCP connection John Smith <12345@whatismyemailaddress.xyz> - 2021-03-15 21:10 +0000

csiph-web