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: 120
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
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9601
Location: almost Mile High in the 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/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

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.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

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: 10587
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
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
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