Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
share internet with a Slack or Arch linux
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
vladimir1986
n00b
n00b


Joined: 09 Dec 2010
Posts: 74

PostPosted: Fri Jan 14, 2011 4:26 pm    Post subject: share internet with a Slack or Arch linux Reply with quote

Well, my problem is this:

I have my laptop, getting internet via wifi in my home, and i have it connected via crossover cable wit a old PIII that has Slack 13.1 installed on it. I use wicd (so dhcpcd) to connect in my wlan0 device (i don't know if this is relevant)

I am thinking on installing Arch on the old computer (no, i DON'T want to compile a full gentoo system with 455 mhz), or in case of saving Slack, at least update some programs i need, without moving physically the computer to a router.

I tried with ifconfig, assigning a static ip on both of them, a mask, and broadcast. I tried the same as it has the laptop (with internet working) too. I tried in the laptop also to assign the same values for eth0 that wlan0, in a hope that would bridge the wifi card with the lan card. No results (at least i can ssh the 2 computers).I don't know what more to do. I searched google, but what i found is how to do it with the connection manager of puppy or ubuntu, but i am not using anything more than my terminals (i want to learn how it works and how to do it!). I am not using iptables, so at least i don't have to create firewall rules.

Anyone can help me? Is not urgent, but i really want to know how it work, and how to do it. Thanks in advance :wink:
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54821
Location: 56N 3W

PostPosted: Fri Jan 14, 2011 7:11 pm    Post subject: Reply with quote

vladimir1986,

There are two ways to do this. Set up your laptop as a router, follow the Gentoo Home Router Guide
This is written as if you set up a deicated PC as a router but you can add it to your laptop.

This is well documented, just works, and allows you to connect a large number of machines to the internet via your laptop.

The alternative is to use PPP on the link between your laptop and Slack install. Both kernels need PPP support and you need a script to set up PPP on the laptop. The downsides are,
a) needing to run the script to get the link up
b) at most one system can be on the end of a PPP link.

I have a script you can build on if you want to go this way. Its written to do PPP over USB but it should be easy to change.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
vladimir1986
n00b
n00b


Joined: 09 Dec 2010
Posts: 74

PostPosted: Sat Jan 15, 2011 11:28 am    Post subject: Reply with quote

I would love to try bot ways. The PPP way would work maybe for my first computer (Pentium I, with pcmcia dial-up modem), so if you post the script, that would be really nice. I have custom kernels in both computers, so i have the fearing part in the .configs done. As for day to day, i think i would use the handbook way. Seriously, i am stunned on how many documentation is aviable for Gentoo. Thanks for everything.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54821
Location: 56N 3W

PostPosted: Sat Jan 15, 2011 11:46 am    Post subject: Reply with quote

vladimir1986,

Here is the script,
Code:
#!/bin/bash
#
# ipaqnet       Control script for iPAQ USBNet connection
#
# Author: Michel Stempin
# Creation: 11/08/2002

# additional comments and minor tweaks
# Roy Bamford 6 Dec 2003

PC_ADDR=192.168.100.201
IPAQ_ADDR=192.168.100.202
IPAQ_NET=192.168.100.0/24

# WARNING:usb0 is hard coded in some places
UPLINK_IF=usb0

start() {
    # load the usb networking module
    /sbin/modprobe usbnet
   
    # bring up the PC end of the link with IP addr PC_ADDR
    # exit if it fails for some reason
    /sbin/ifconfig usb0 inet $PC_ADDR up
    if [ $? -ne 0 ]; then
        echo "Could not set up usb0"
        echo "Is the iPaq connected and switched on?"
        exit 1
    fi
 
    # set up proxy_arp for our usb interface
    echo "1" >/proc/sys/net/ipv4/conf/usb0/proxy_arp
    UPLINK=`/sbin/ifconfig $UPLINK_IF >/dev/null 2>&1`
    # exit if it fails for some reason
    if [ $? -ne 0 ]; then
        echo "Could not set up proxy_arp for usb0"
        exit 1
    fi
 
    # set up proxy_arp for eth0, so this better be our
    # internet connection
    echo "1" >/proc/sys/net/ipv4/conf/eth0/proxy_arp

    # turn on IP forwarding
    echo "1" >/proc/sys/net/ipv4/ip_forward

    # delete the unwanted route via usb0
    # its wrong anyway
    /sbin/route del -net $IPAQ_NET dev usb0

    # add the route we really want
    /sbin/route add $IPAQ_ADDR dev usb0
}

stop() {
    /sbin/ifconfig usb0 down
    # rmmod -r usbnet
}
case "$1" in
    start|add)
        start
        ;;
    stop|remove)
        stop
        ;;
    *)
        echo $"Usage: $0 {start|stop|add|remove}"
        exit 1
esac


You need to change the
Code:
PC_ADDR=192.168.100.201
IPAQ_ADDR=192.168.100.202
IPAQ_NET=192.168.100.0/24
lines and the interface name usb0 wherever it occurs.
You can change the usb0 to a var and define it with the others, it looks like that work was started.
This script runs on the system with the internet connection.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
vladimir1986
n00b
n00b


Joined: 09 Dec 2010
Posts: 74

PostPosted: Mon Jan 17, 2011 3:35 pm    Post subject: Reply with quote

Hello, and thanks for the reply.

I did all you tell, but have some doubts:

IPAQ_ADDR, IPAQ_NET... are the ip of the guest system?

And what i do on the guest after executing the script on the host?

As far from the handbook... i have to adapt a bit, as they are thinking of two net cards... i have only one, and the wifi card communicating with the router. I assume is not very different.

I cant do anything untill tomorrow anyway, so i will post the results tomorrow.

Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54821
Location: 56N 3W

PostPosted: Mon Jan 17, 2011 7:17 pm    Post subject: Reply with quote

vladimir1986,

vladimir1986 wrote:
IPAQ_ADDR, IPAQ_NET... are the ip of the guest system?


Yes, thats right. IPAQ_ADDR must be a static IP in the same subnet as your laptop. It will get assigned to your slackware box.
IPAQ_NET is the subnet mask. Thats the same as the subnet mask for your laptop.

After you run the script, your should have an interface on slackware called ppp0, which just works.
The slackware kernel needs to support PPP.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum