You are not logged in.

#1 2010-02-18 17:33:00

linuxguy
Member
Registered: 2008-10-20
Posts: 41

Bridge WIFI and ethernet

Hey i have an lenovo x200 laptop.  I have a wireless port and an ethernet port.  I would like to bridge the network ports so a microcontroller device with dhcpcd that are plugged in over ethernet will be network addressable over the internet via my wifi connection.  so basically my laptop should act as a wireless router.  hopefully it can be done with a set of commands rather than have the connection start up every time i start up the machine.

the microcontroller board can connect to my laptop. get an ip address and communicate with the laptop over the ethernet connection but i would like to then access it over the internet from another machine which will access the board over wireless.

I installed bridge-utils and i see lots of guides for ubuntu users who are modifying /etc/network/interfaces but that doesnt exist on arch.

Thanks for the help.

Offline

#2 2010-02-18 19:51:53

ADVanZe
Member
Registered: 2006-05-19
Posts: 3

Re: Bridge WIFI and ethernet

This is what i do, assuming,
eth0: is your ethernet and wlan0: is your wifi interfaces.
(as root)

 /sbin/ifconfig eth0 192.168.0.128 up
 echo "1"> /proc/sys/net/ipv4/ip_forward
/usr/sbin/iptables -F
/usr/sbin/iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

Offline

#3 2010-02-19 07:27:12

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: Bridge WIFI and ethernet

if you want the board to access the internet, use the steps described by ADVanZe. but it looks like you want to access the microcontroller board from the internet as well, if so, then you should bridge the wifi and ethernet together, otherwise you would have to DNAT twice (assuming wlan0 is a private ip address). if its a publicly accessible ip address, simply DNAT it with iptables.

Offline

Board footer

Powered by FluxBB