|
|
An item for the discussion of direct connections between computers...
13 responses total.
On a unix system (I use NetBSD, but data points from other systems are welcome), what is the drill for connecting two hosts together using SLIP? I have an appropriate DTE-DTE "null modem" cable in place and I've tested it using an ordinary tty login. Assuming the kernels at each end support SLIP, is it just a question of running slattach at each end and then using something like ifconfig to assign an IP address to each end of the cable?
I have never worked with NBSD, but if memory serves me correctly, you would first have to make sure you have slip support in your operating environment's kernel, then plumb your slip0 interface, set up your /etc/hostname.slip0 with your IP number and your peer's IP number, set your route and then run your slip programme (slattach, I guess).
http://www.netbsd.org/guide/en/chap-net-practice.html#chap-net-practice-p 2p-via-serial
I'm curious why anybody would make such a connection these days. Wouldn't it be easier and faster to connect them using a crossover ethernet cable?
If the device does not have a typical network interface, or if it has a network interface for which drivers are not available, it would be appropriate. Additionally, this may be done as a learning opportunity.
Re #3: That's almost identical to what I tried. Perhaps my default route is sending datagrams barking up the wrong tree though. I'll have a tinker when I get home. Re #4: I anticipate doing some work on boards that lack a wired network port, so... Re #5: Spot on: I want to learn how to do it.
If learning is your goal, I'd also suggest playing with PPP a bit as well. It's actually quite easy to get a PPP connection going between two computers, and turning up the logging level and watching how they negotiate the connection settings is pretty educational. PPP is in much more common usage than SLIP, these days.
PPP is worth learning, but I would recommend learning SLIP first, as it will give some perspective on where the peculiarities of PPP come from, once you see the deficiencies that they were invented to address. I also strongly recommend that you read _TCP/ip_Illustrated_ by Stephens and _IP_Routing_Fundamentals_ by Sportack.
SLIP seems cleaner than PPP, especially since the payload is
strictly IP. I have used PPP with a modem before, but never
over a direct cable connection. I'll keep it in mind as a
potential future experiment though.
I got SLIP working between two hosts by making ifconfig.sl0
files in each machine's /etc directory containing...
! /sbin/slattach -h -s 115200 /dev/tty00
inet 192.168.3.128 192.168.3.129 up
...but with the IP addresses reversed at one end.
Sweet. Thanks for posting your solution.
NBSD uses /etc/ifconfig.${ifname}? I thought the BSD standard was
/etc/hostname.${ifname}. One learns something new every day.
I find ifconfig.{if} more intuitive.
,-------------, ,-------------,
|tinman | |almond |
| | | |
|192.168.3.129|---slip---|192.168.3.128| to LAN,
| | |192.168.0.254|---> router etc.
`-------------' `-------------'
As a temporary measure while I'm setting up software on
tinman, I would like almond to forward datagrams from its
SLIP interface out through the 10baseT port onto the LAN and
to accept datagrams for tinman from the LAN and forward them
down the right hole. I understand that I need to use proxy-
arp on almond so that it's MAC address is provided when some
-one tries to look up tinman. What should I use to forward
the datagrams though? NAT need not apply.
You can set up almond to act as a router and advertise a route to 192.168.3.128/30 (you need to give it a /30, not a /31, since you lose one address to the wire and one to the broadcast for any netblock, even if a wire and broadcast are silly on a point-to-point link). I believe all of the versions of BSD come with routed, which you can use to accomplish this.
Re resp:9: If you're only carrying IP, and only between two hosts, SLIP is indeed simpler. (In fact, it's about as simple as it could possibly get.) It gets messy in a hurry if you have to support multiple peers, though, because it has no support for things like automatically assigning IP addresses.
Response not possible - You must register and login before posting.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss