two computers, one wifi connection
two computers, one wifi connection
my friend has two computers side by side connected using a ethernet cord. the wifi connection on one computer is using the internet from the router, in the next room. he doesnt have a 50 ft ethernet cable to connect it to the router, only a 3 ft, and that wont do ofcourse. is there anyway that this person can connect to the internet of one wifi adapter? they are connected into a small 2 computer network both on windows 7 ultimate, but one has a wifi connection, and he doesnt have another wifi adapter. is there anyway both computers can use one wifi adapter for one wifi connection?
Re: two computers, one wifi connection
On the computer that has both ethernet and WiFi, go into the network connections window (where the adapters are listed) and select both of the connections. Then right-click on either of the connections (doesn't matter which one) and click Bridge Connections (or Create Bridge, or whatever it's called). Now just pretend it's all one big network.
Re: two computers, one wifi connection
How to do this on ubuntu? (relevant to my interests)
Valix is an experiment in an interpreted userspace with object-oriented and functional design patterns. Developers needed! Join #valix on irc.freenode.net
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: two computers, one wifi connection
There's a trick I hacked together from a collection of tutorials that seems to work:
This scripts sets up a pair of interfaces to act as a NAT.
You could also use brctl to bridge both connections, but I could never get that to work properly personally.
Code: Select all
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage: $0 <external interface> <internal interface>" >&2
exit 1
fi
# Flush all the rules in filter and nat tables
iptables --flush
iptables --table nat --flush
# Delete all chains that are not in default filter and nat table
iptables --delete-chain
iptables --table nat --delete-chain
# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface $1 -j MASQUERADE
iptables --append FORWARD --in-interface $2 -j ACCEPT
#Enables packet forwarding by kernel
echo 1 > /proc/sys/net/ipv4/ip_forward
You could also use brctl to bridge both connections, but I could never get that to work properly personally.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
- xenos
- Member
- Posts: 1118
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: two computers, one wifi connection
I have a small server running Ubuntu which also works as a router, so it is connected to my DSL modem and provides internet access to any computer in my local network. I also use iptables, as shown in the code above. There is a nice tutorial on the web, which I used to set up my server and which explains the whole thing in more detail. You can find it here:
http://www.ecst.csuchico.edu/~dranch/LI ... tml#ipmasq
It's call "IP masquerading HOWTO", because this way of providing internet access to computers on a local network "hides" them behind a "mask", namely the router.
http://www.ecst.csuchico.edu/~dranch/LI ... tml#ipmasq
It's call "IP masquerading HOWTO", because this way of providing internet access to computers on a local network "hides" them behind a "mask", namely the router.
Re: two computers, one wifi connection
I don't really know anything about networking or iptables, so I tried to run this script like "./script.sh wlan0 eth0" and it doesn't work. Anything I'm missing?thepowersgang wrote:There's a trick I hacked together from a collection of tutorials that seems to work:This scripts sets up a pair of interfaces to act as a NAT.Code: Select all
#!/bin/sh if [ $# -ne 2 ] then echo "Usage: $0 <external interface> <internal interface>" >&2 exit 1 fi # Flush all the rules in filter and nat tables iptables --flush iptables --table nat --flush # Delete all chains that are not in default filter and nat table iptables --delete-chain iptables --table nat --delete-chain # Set up IP FORWARDing and Masquerading iptables --table nat --append POSTROUTING --out-interface $1 -j MASQUERADE iptables --append FORWARD --in-interface $2 -j ACCEPT #Enables packet forwarding by kernel echo 1 > /proc/sys/net/ipv4/ip_forward
You could also use brctl to bridge both connections, but I could never get that to work properly personally.
Valix is an experiment in an interpreted userspace with object-oriented and functional design patterns. Developers needed! Join #valix on irc.freenode.net
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: two computers, one wifi connection
I forgot to say that you need to have two networks for that script. One subnet (say 10.0.0.0/24) for the eth0 side, and another (192.168.1.0/24 or your current subnet) on the wlan0 side.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: two computers, one wifi connection
Um, and how would I go about setting that up?
Valix is an experiment in an interpreted userspace with object-oriented and functional design patterns. Developers needed! Join #valix on irc.freenode.net
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: two computers, one wifi connection
Just set the IP setting manually for the "local"/nat side to something like 10.0.0.1.
But for what you seem to want to do, it might be easier to look into making a true network bridge, so both computers get IPs from DHCP
But for what you seem to want to do, it might be easier to look into making a true network bridge, so both computers get IPs from DHCP
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc