Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Share Wi-Fi over Ethernet
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
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 100
Location: Italy

PostPosted: Thu Sep 20, 2012 10:31 am    Post subject: Share Wi-Fi over Ethernet Reply with quote

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
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3825
Location: USA

PostPosted: Thu Sep 20, 2012 5:04 pm    Post subject: Reply with quote

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.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2192

PostPosted: Thu Sep 20, 2012 5:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2278
Location: UK

PostPosted: Thu Sep 20, 2012 7:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7667
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Sep 21, 2012 1:26 pm    Post subject: Reply with quote

Split Windows XP networking advice to here in Off the Wall, if anyone cares.

- John
_________________
This space intentionally left blank.
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