Using an RPi 3B+ as a "post office" between two subnets ? - Page 6

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: Using an RPi 3B+ as a "post office" between two subnets ?
R.Wieser wrote:

Quoted text here. Click to load it

Same as on windows, if linux has two or more interfaces it won't route  
between them unless you tell it you want that.


Re: Using an RPi 3B+ as a "post office" between two subnets ?
Andy,

Quoted text here. Click to load it

:-) The last time I looked at it you /couldn't/ seperate them. Than again,  
that was Win98.   Can't remember having ever tried to put multiple ethernet  
cards in a 'puter after that though.

Regards,
Rudy Wieser



Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 6/28/20 5:04 AM, R.Wieser wrote:
Quoted text here. Click to load it

Linux kernel will quite happily support multiple network interfaces and  
will not enable communications between hosts on separate networks  
without you doing something to enable it.

Some Linux distributions may change this kernel default as part of their  
start up scripts.

There is some minutia about which address A uses when talking to B, be  
it AB or BC.  But this minutia shouldn't impact what you are doing.

Comparing the Linux TCP/IP stack to a Microsoft TCP/IP stack, especially  
one 20+ years old, is disingenuous.  It's sort of like saying that  
anything faster than 10 Mbps Ethernet connections is cost prohibitive  
and outside the reach of anything but servers.



--  
Grant. . . .
unix || die

Re: Using an RPi 3B+ as a "post office" between two subnets ?
declaimed the following:


Quoted text here. Click to load it

    In some situations, that is common... And everytime you plug an
USB<>Ethernet dongle into one, you've added the equivalent of an additional
NIC.

    The network connections list on my Win10 box currently shows

Ethernet (Realteck PCIe GBE controller)
Ethernet 6 (VirtualBox Host Only Ethernet)
Ethernet 7 (ASIX AX88772 USB2.0 to Fast Ethernet [the SIIG dongle])
vEthernet (Hyper-V Virtual Ethernet Adapter)
Wi-Fi (Intel Centrino Wireless...)

    The problem with all those is that activating Wi-Fi overrides the
Ethernet, but the others are active. As far as Windows is concerned there
are FIVE NICs on this machine.


--  
    Wulfraed                 Dennis Lee Bieber         AF6VN
     snipped-for-privacy@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 26/06/2020 07:43 pm, R.Wieser wrote:
Quoted text here. Click to load it

As Andy says, get a USB ethernet device eg  
https://www.amazon.co.uk/TeckNet-1000Mbps-Ethernet-Indicator-Compatible/dp/B003EDY97A/ref=sr_1_6?crid32%S9GTPRH0137&dchild=1&keywords=usb+ethernet+adapter&qid15%93199202&sprefix=usb+ethernet%2Caps%2C246&sr=8-6

Put built-in ethernet on one segment and the USB one on the other. Plug  
adapters into relevant switch/router. Computers on each segment can then  
"talk" to the pi.

To set up ftp, install vsftpd and see here  
https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-for-anonymous-downloads-on-ubuntu-16-04

The /var/ftp/pub (or /srv/ftp/pub) is then a public directory where any  
user can upload or download files. If you need more security, come back.

You can use ftp (from the command line) or something like Filezilla from  
Windows or Linux to up or download files anonymously.  
/var/log/vsftpd.log will keep a record of who does what and from which  
IP address.

As I said earlier, this simple install will only be sufficient for an  
internal ftp server where you can be sure your clients can be trusted.


--  

Chris Elvidge, England

Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 26/06/2020 08:44 pm, Chris Elvidge wrote:
Quoted text here. Click to load it
Use ftp as the user in vsftpd.conf, make /var/ftp/pub user ftp:ftp


--  

Chris Elvidge, England

Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 23/06/2020 06:34 pm, R.Wieser wrote:
Quoted text here. Click to load it

Reading through this thread it seems you're worried that adding a USB  
ethernet dongle would slow traffic down. The built-in ethernet on the Pi  
hangs off the USB bus; adding another dongle uses the same USB bus. So,  
no extra slowdown. Two ethernet ports would normally be on two separate  
LAN segments, with (on Linux anyway) no connection between them unless  
forwarding is enabled - not by default.

Then look at NFS (network file system). Add nfs-kernel-server to your  
Pi. Both Windows and Linux have NFS clients.

You can then export a single directory which can be mounted by clients.
Each client can then read and write (if set up like that) to that  
directory as if it were a local directory.
e.g. in /etc/exports (/var/ftp/pub is on the Pi) (see also below)
this exports a public directory
/var/public    192.168.0.0/24(rw,sync) 192.168.100.0(rw,sync)

Each (linux) client has a line in /etc/fstab

server:/path/to/export localmountpoint fstype option,option,...    0 0

e.g.
raspberrypi:/var/public /home/rudy/raspberry nfs rsize81%92,wsize81%92 0 0

Options can be found in man nfs.

from man exports:
EXAMPLE
        # sample /etc/exports file
        /               master(rw) trusty(rw,no_root_squash)
        /projects       proj*.local.domain(rw)
        /usr            *.local.domain(ro) @trusted(rw)
        /home/joe       pc001(rw,all_squash,anonuid15%0,anongid10%0)
        /pub            *(ro,insecure,all_squash)
        /srv/www        -sync,rw server @trusted @external(ro)
        /foo            2001:db8:9:e54::/64(rw) 192.0.2.0/24(rw)
        /build          buildhost[0-9].local.domain(rw)

The first line exports the entire filesystem to machines master and  
trusty. In addition to write access, all uid squashing is turned off  
for host trusty.
The second and third entry show examples for wildcard hostnames and net?  
    groups (this is the entry `@trusted').
The fourth line shows the entry for the PC/NFS client discussed above.  
Line  5 exports the public FTP directory to every host in the world,  
executing all requests under the nobody account. The insecure option in  
this entry also allows clients with NFS implementations that don't use a  
reserved port for NFS.
The sixth line  exports a directory read-write to the machine 'server'  
as well as the `@trusted' netgroup, and read-only to netgroup  
`@external', all three mounts with the `sync' option enabled.
The seventh line  exports  a  directory  to both an IPv6 and an IPv4  
subnet.
The eighth line demonstrates a character class wildcard match.



--  

Chris Elvidge, England

Re: Using an RPi 3B+ as a "post office" between two subnets ?
Chris,

Quoted text here. Click to load it

Nope, not at all.   Its just one thing to consider when having to make a  
choice between options.

Quoted text here. Click to load it
....

Thanks for the suggestion & explanation. :-)

Regards,
Rudy Wieser



Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 23/06/2020 06:34 pm, R.Wieser wrote:
Quoted text here. Click to load it

There is a loadable module included with the bash source called  
'accept'. It's help says:

accept: accept [-t timeout] [-v varname] [-r addrvar ] port
   Accept a network connection on a specified port.
   This builtin allows a bash script to act as a TCP/IP server.

   Options, if supplied, have the following meanings:
     -t timeout  wait TIMEOUT seconds for a connection. TIMEOUT may
                 be a decimal number including a fractional portion
     -v varname  store the numeric file descriptor of the connected
                 socket into VARNAME. The default VARNAME is ACCEPT_FD
     -r rhost    store the IP address of the remote host into the shell
                 variable RHOST, in dotted-decimal notation

If successful, the shell variable ACCEPT_FD, or the variable named by  
the -v option, will be set to the fd of the connected socket, suitable  
for use as 'read -u$ACCEPT_FD'. RHOST, if supplied, will hold the IP  
address of the remote client. The return status is 0.

On failure, the return status is 1 and ACCEPT_FD (or VARNAME) and RHOST,  
    if supplied, will be unset.

The server socket fd will be closed before accept returns.


Could this be what you're looking for? Implementation is left as an  
exercise for the reader. I can't find any info about it on the web  
(cursory look).


--  

Chris Elvidge, England

Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 30/06/2020 15:44, Chris Elvidge wrote:
Quoted text here. Click to load it


Quoted text here. Click to load it

Didn't know about that. accept() is also a linux system call, see man  
accept.

Re: Using an RPi 3B+ as a "post office" between two subnets ?
On 30/06/2020 02:55 pm, A. Dumas wrote:
Quoted text here. Click to load it

man 2 accept
man accept gets me cupsaccept out of man section 8 (slackware)


--  

Chris Elvidge, England

Re: Using an RPi 3B+ as a "post office" between two subnets ?
Quoted text here. Click to load it

Oh, right. Worked for me on Raspbian ("RaspiOS"?) but I don't have cups
installed. And yes it's in 2:

pi@dev:~ $ man -k accept
accept (2)           - accept a connection on a socket
accept4 (2)          - accept a connection on a socket
Log::Dispatch::Null (3pm) - Object that accepts messages and does nothing
signalfd (2)         - create a file descriptor for accepting signals
signalfd4 (2)        - create a file descriptor for accepting signals
xdr_accepted_reply (3) - library routines for remote procedure calls
XtCallAcceptFocus (3) - calla widget's accept_focus procedure


Site Timeline