| View previous topic :: View next topic |
| Author |
Message |
GSnake Tux's lil' helper

Joined: 10 Sep 2012 Posts: 91 Location: Italy
|
Posted: Thu Sep 20, 2012 10:31 am Post subject: Share Wi-Fi over Ethernet |
|
|
Hello guys!
I tried to understand how to bridge my connection to my ethernet card but I failed.
Could someone please guide me in doing this (maybe explanating also WHY we're doing this and that?)
Thank you guys! |
|
| Back to top |
|
 |
eccerr0r Advocate

Joined: 01 Jul 2004 Posts: 2995 Location: USA
|
Posted: Thu Sep 20, 2012 5:04 pm Post subject: |
|
|
It would help us more if you told exactly what hardware you have and what you're trying to do?
Because if you have a wireless access point it will automatically bridge to Ethernet, or at least it usually is designed that way. _________________ Core-i7-2700K@4.1GHz/8GB RAM/180GB SSD/Intel HD3000 graphics
What the heck am I advocating? |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1254
|
Posted: Thu Sep 20, 2012 5:59 pm Post subject: |
|
|
GSnake ...
my guess is that you are not really looking to bridge, but simply NAT traffic from one interface to the other in order to share the wireless connection on machine1 with machine2 connected via ethernet.
If both machines ethernet cards are Auto-MDIX capable then a regular cable can be used, if not then a cross cable will be required. Also, netfilter will be need to be enabled in the kernel of machine1 (including NF_NAT), and net-firewall/iptables installed.
I will assume that the network interface wlan0 in machine1 is established. The ethernet connection on machine1 and machine2 look like the following (here using Class C addressing, but these could be a local link addresses in the 169.254.0.0/16 range).
machine1:
| Code: | | config_eth0="192.168.2.1/24" |
machine2:
| Code: | config_eth0="192.168.2.2/24"
routes_eth0="default via 192.168.2.1"
dns_servers_eth0="xxx.xxx.xxx.xxx" |
The DNS address could be the same as supplied via your wireless router, or ISP, or provided by machine1 (if you happen to run a local dns service, or dnsmasq).
On machine1 one you would then enable forwarding and set the NAT to masquerade traffic to wlan0
| Code: | # echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE |
.... and there you have it, an explanation would probably just confuse things, and there are plenty of tutorials out there on basic networking.
best ... khay |
|
| Back to top |
|
 |
Ant P. Veteran

Joined: 18 Apr 2009 Posts: 1917 Location: UK
|
Posted: Thu Sep 20, 2012 7:33 pm Post subject: |
|
|
| If you still want to bridge the interfaces, you should add wlan0 to the bridge first so that inherits its MAC address. Most wi-fi hardware I've used doesn't work properly with traffic addressed to something else. |
|
| Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 6423 Location: Somewhere over Atlanta, Georgia
|
Posted: Fri Sep 21, 2012 1:26 pm Post subject: |
|
|
Split Windows XP networking advice to here in Off the Wall, if anyone cares.
- John _________________ This space intentionally left blank. |
|
| Back to top |
|
 |
|