You are not logged in.

#1 2009-12-12 00:41:56

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Share Internet by crossover cable

How can I share Internet connection by crossover cable?

I have Ubutnu on my laptop. On there, wireless and everything works.

However I am trying to install Arch-linux on my main (desktop) PC. And there, during basic install, it can not detect my wireless connection.

How can I share connection from my laptop with my desktop?

How can I connect to the connect on my laptop from Arch?

Last edited by kdar (2009-12-12 21:42:34)

Offline

#2 2009-12-12 04:04:10

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Share Internet by crossover cable

A bridge might be able to accomplish this, but I am not sure.

EDIT: I doubt a bridge will help you. I think you need IP masquerading

Last edited by pyther (2009-12-12 04:06:04)


Website - Blog - arch-home
Arch User since March 2005

Offline

#3 2009-12-12 04:35:57

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: Share Internet by crossover cable

#!/bin/bash
# Shares internet from wlan0 through eth0

case "$1" in 
    start)
ifconfig eth0 up
ifconfig eth0 192.168.0.1
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "set other computers in the range of"
echo "192.168.0.0 255.255.255.0"
echo "gateway 192.168.0.1"
echo "dns 192.168.10.1"  #this is my router's ip, you should use yours or another dns server
;;
    stop)
echo 0 > /proc/sys/net/ipv4/ip_forward
ifconfig eth0 down
iptables --table nat --delete POSTROUTING --out-interface wlan0 -j MASQUERADE
;;
    *)
echo "usage: $0 {start|stop}"
;;
esac

this does just that wink

check if iface names and ips fit your gear, the network between both computers connected with the x-over cable must be different from your router's lan network.

Last edited by eldragon (2009-12-12 04:42:35)

Offline

#4 2009-12-12 08:40:19

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Share Internet by crossover cable

kdar wrote:

during basic install, it can not detect my wireless connection.

Everything you need to get your wifi connection up and running is included on th install iso/usb - you just need to set it up yourself.

Offline

#5 2009-12-12 16:02:58

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

Re: Share Internet by crossover cable

eldragon wrote:
#!/bin/bash
# Shares internet from wlan0 through eth0

case "$1" in 
    start)
ifconfig eth0 up
ifconfig eth0 192.168.0.1
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "set other computers in the range of"
echo "192.168.0.0 255.255.255.0"
echo "gateway 192.168.0.1"
echo "dns 192.168.10.1"  #this is my router's ip, you should use yours or another dns server
;;
    stop)
echo 0 > /proc/sys/net/ipv4/ip_forward
ifconfig eth0 down
iptables --table nat --delete POSTROUTING --out-interface wlan0 -j MASQUERADE
;;
    *)
echo "usage: $0 {start|stop}"
;;
esac

this does just that wink

check if iface names and ips fit your gear, the network between both computers connected with the x-over cable must be different from your router's lan network.

Wow! I got to try this out!


How's my programming? Call 1-800-DEV-NULL

Offline

#6 2009-12-12 21:30:38

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Share Internet by crossover cable

I got it working!! smile Thank you everyone for help.

But actually what I had to do is this:

iwconfig wlan0 enc my_key
iwconfig wlan0 essid "my_network_name"
dhcpcd eth1 -d

apparently my card works just fine... I just never connected to a network by terminal before.

Last edited by kdar (2009-12-12 21:42:23)

Offline

#7 2009-12-12 22:07:25

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Share Internet by crossover cable

fyi - you can use a single iwconfig command i.e.

iwconfig wlan0 essid "my_network_name" enc my_key

And the -d flag for dhcpcd is only necessary for debugging.

Offline

#8 2009-12-12 22:56:57

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Share Internet by crossover cable

tomk wrote:

fyi - you can use a single iwconfig command i.e.

iwconfig wlan0 essid "my_network_name" enc my_key

And the -d flag for dhcpcd is only necessary for debugging.

ah. thanks. I didn't know

Offline

#9 2009-12-13 02:28:55

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Share Internet by crossover cable

How do I make it remember the key and network name with every boot?

Offline

#10 2009-12-13 02:44:45

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Share Internet by crossover cable

Have a look at netcfg.

Offline

#11 2009-12-13 08:03:02

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

Re: Share Internet by crossover cable

I use wicd. It has a terminal client, wicd-curses.


How's my programming? Call 1-800-DEV-NULL

Offline

#12 2009-12-13 17:14:24

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Share Internet by crossover cable

What will work best for KDE4?

Offline

Board footer

Powered by FluxBB