LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   serial port network connection (https://www.linuxquestions.org/questions/linux-networking-3/serial-port-network-connection-378168/)

eantoranz 10-29-2005 07:11 PM

serial port network connection
 
Is it possible to connect two computers by a serial cable?

I think it's possible with SLIP, but I'm not sure. I just need to provide internet access to another computer, but their link is a serial cable. Is that possible? *-)

I loaded the slip module on the "internet connected" box, but that didn't create another network interface. I had read that I would have a sl0 interface. :confused:

michaelk 10-30-2005 05:04 PM

You can use PPP to establish a connetion between to PCs.
http://www.tldp.org/HOWTO/PPP-HOWTO/direct.html

eantoranz 10-31-2005 08:05 AM

Hey.. that looks pretty simple! :-) Thanks for the tip... I'll keep it in mind next time I have to do this.

I ended up solving the problem with slattach.

once you run slattach on a given serial port, there will be a new network interface. sl0 in my case.

I had to do something like this:

Client:
Code:

slattach /dev/ttyS0 &
ifconfig sl0 192.168.0.2
route add -host 192.168.0.1 dev sl0
route add default gw 192.168.0.1

server (not taking care of firewall... just routing to the client):
Code:

slattach /dev/ttyS0 &
ifconfig sl0 192.168.0.1
route add -host 192.168.0.2 dev sl0

By the way.... it is a very good idea to change the speed of the serial ports... to something higher that 9600.. but I can't remember what the command for that was.... anyway, the ppp solution seems a lot easier... so you could simply stick with that one.

Cheers!


All times are GMT -5. The time now is 02:42 AM.