LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2014, 09:35 AM   #1
Tonga
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Rep: Reputation: Disabled
Internet over Serial line (using XBee)


Hi there,

I'd like to tunnel my Internet connection to a second PC using a serial line connection (using XBee radio modules).

Something like this:
eth0(host1) <-> XBee(1) <-> ... ... <-> XBee(2) <-> eth0(host2)

I managed to setup a serial connection between the two PCs - that works fine. But how can I transmit "The Internet" over this line?

Do I need PPP, SLIP, slattach, ...?

cheers,
T.
 
Old 12-30-2014, 09:39 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You should read the serial HOWTO and other related HOWTO's from http://www.tldp.org

Last edited by veerain; 12-31-2014 at 11:01 PM.
 
Old 12-30-2014, 12:48 PM   #3
Tonga
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
You should read teh serial HOWTO and other related HOWTO's from http://www.tldp.org
Or I could ask a question in teh linuxquestions.org - and hope for a non bullshit reply. Unlike teh yours


From what I think how it should work:
Server:
modprobe slip
slattach -L -s 115200 -p slip /dev/ttys0 &
ifconfig sl0 172.16.0.1 dstaddr 172.16.0.2
echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
iptables -t nat -A POSTROUTING -s 172.16.0.2 -o eth0 -j MASQUERADE

Client:
modprobe slip
slattach -L -s 115200 -p slip /dev/ttys0 &
ifconfig sl0 172.16.0.2 dstaddr 172.16.0.1
ip route add default via 172.16.0.1 dev sl0
echo nameserver 8.8.8.8 > /etc/resolv.conf

... problem is: it does not work Ping timeouts ...
 
Old 12-30-2014, 04:32 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,926

Rep: Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000
The documentation is a bit old but you would want to set up a ppp connection over a serial cable (or null modem). SLIP would also work. Technically it would be just:

host-2 -> ppp via Xbee -> host-1 -> eth0

In a nutshell you would configure iptables for NAT between the serial port (ppp0) and eth0 for host-1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Serial line locked - by what? bogzab Linux - Desktop 2 05-25-2016 07:51 PM
Serial console not going to next line aureum Linux - Newbie 3 04-12-2012 04:07 PM
Need a SLIP server (Serial Line Internet Protocol) mghis Linux - Networking 4 10-25-2010 11:05 AM
LILO with a serial line raypen Linux - Software 3 05-22-2008 10:22 AM
How to disable serial line eaglegst Debian 2 05-28-2004 03:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration