Kommunikation zwischen zwei Systemen mit pppd

2848
liv2hak

Ich habe zwei Vritual Machines (Teil eines überbrückten Netzwerks) (beide Ubuntu 64-Bit), auf denen Oracle VM Box ausgeführt wird.

Ich kann mit netcat zwischen den beiden Maschinen kommunizieren. Ich habe auf beiden Maschinen einen ppp-Dämon installiert. Der Name und die IP-Adresse der Maschinen sind unten angegeben.

nas 192.168.129.153 (fungiert als Server) home_user 192.168.129.152 (fungiert als der)

Ich führe die folgenden Befehle vom Server bzw. vom Client aus

@Server (nas) sudo pppd 192.168.129.153:192.168.129.152 nicht angegeben pty "nc -l 3333 pppd"

@Client (home_user) sudo pppd 192.168.129.152:192.168.129.153 nicht angegeben pty “nc 129.168.129.153 3333”

Ich erhalte folgende Meldungen vom Server bzw. vom Client.

@Server


sudo pppd 192.168.129.152:192.168.129.153 nodetach pty "nc 192.168.129.153 3333"  Using interface ppp0  Connect: ppp0 <--> /dev/pts/2  CCP: timeout sending Config-Requests  IPCP: timeout sending Config-Requests  Connection terminated.  Modem hangup Child process nc 192.168.129.153 3333 (pid 2298) terminated with signal 15 

@Klient


sudo pppd 192.168.129.153:192.168.129.152 nodetach pty "nc -l 3333" Using interface ppp0 Connect: ppp0 <--> /dev/pts/1 Deflate (15) compression enabled local IP address 192.168.129.153 remote IP address 192.168.129.152 No response to 4 echo-requests Serial link appears to be disconnected. Connect time 2.5 minutes. Sent 1060 bytes, received 0 bytes. Connection terminated. Modem hangup. 

Mein letztes Ziel ist es, die Authentifizierung zu deaktivieren und dem NAS (Server) eine feste IP-Adresse und eine Standardroute zum Heimbenutzer-Ende bereitzustellen.

Jede Hilfe wäre sehr dankbar.

2

1 Antwort auf die Frage

2
Slartibartfast

First: Whoa, that's pretty cool :) It's been a while since I saw someone do something clever with PPP.

Second: Really not clear on why. You already have IP based communication between the two hosts, it doesn't give you much in the way of privacy (probably not anything, really)...?

Now, the brass tacks:

The IP addresses specified in the arguments to pppd seem wrong for two reasons:

  1. They appear to be the same as the IP addresses of the two machines on different (non-PPP) interfaces. I can't think of a situation where that is correct. In my opinion this is the cause of your problem. You're trying to ping an IP address that exists on the other end of two interfaces, and that itself is intended to have two interfaces with that IP address.

  2. You're specifying the IP addresses on both the client and the server. That's technically okay, but since over-specifying here can cause a failure to negotiate, I'd remove the IP addresses from the client and instead set noipdefault there.

I would suggest picking an IP address pair for PPP negotiation that are NOT on a valid public network (you've done that), and that are NOT associated with a network that is already accessible to your two computers. E.g. 10.1.1.1:10.1.1.2

This looks like the following when done over the loopback interface:

Server:

$ sudo pppd 10.1.1.1:10.1.1.2 nodetach pty "nc -l 3333" Using interface ppp0 Connect: ppp0 <--> /dev/pts/4 Deflate (15) compression enabled local IP address 10.1.1.1 remote IP address 10.1.1.2 

Client:

jnisbet2@decimate:~$ sudo pppd noipdefault nodetach pty "nc 127.0.0.1 3333" Using interface ppp1 Connect: ppp1 <--> /dev/pts/6 Deflate (15) compression enabled local IP address 10.1.1.2 remote IP address 10.1.1.1 

The only practical effect of this process is to give you a different IP address for communicating with the remote host, and this is only really visible from inside the two endpoint hosts, so I'm not sure why you're interested in this project, but shrug. Oh, and there is a timeout for the server; if there is no connection within a minute or two, the server quits:

LCP: timeout sending Config-Requests Connection terminated. Modem hangup Child process nc -l 3333 (pid ####) terminated with signal 15 
Ich weiß nicht, warum das OP es will, aber ich verwende es, um einseitige Verbindungen in bidirektionale Verbindungen durch Firewalls und dergleichen zu verwandeln oder eine direkte Verbindung über mehrere Hops zu tunneln. Perkins vor 5 Jahren 0