哈哈,我在工作,但是需要一些魔术:)
因此,使用以下命令配置第一个对等方:
PC1:1) slattach -L -s 57600 -p slip /dev/ttyUSB0 &2) ifconfig sl0 up3) socat TUN:192.168.1.1/24,up INTERFACE:sl0 &
…和第二个点上的类似:
PC2:1) slattach -L -s 57600 -p slip /dev/ttyUSB0 &2) ifconfig sl0 up3) socat TUN:192.168.1.2/24,up INTERFACE:sl0 &
现在,您可以成功从另一台计算机ping一台PC:
PC1:1) ping -c 5 192.168.1.2PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.64 bytes from 192.168.1.2: icmp_req=1 ttl=64 time=348 ms64 bytes from 192.168.1.2: icmp_req=2 ttl=64 time=551 ms64 bytes from 192.168.1.2: icmp_req=3 ttl=64 time=557 ms64 bytes from 192.168.1.2: icmp_req=4 ttl=64 time=549 ms64 bytes from 192.168.1.2: icmp_req=5 ttl=64 time=348 ms--- 192.168.1.2 ping statistics ---5 packets transmitted, 5 received, 0% packet loss, time 4003msrtt min/avg/max/mdev = 348.116/471.143/557.128/100.177 ms
由于
slattach使用起来有些棘手,但实际上任何其他解决方案都必须使用诸如slip之类的东西来组织串行线上的帧。例如,PPP使用类似HDLC的帧。



