do i have to bridge a wireless and wired connection on the same linux box
first of sorry if posted before or if it should be in wireless
im on a red hat 9 box and im after installing a netgear ma311 wireless card to act as an access point with the driver hostap
all is well (i think anyway so far)
i have a wired connection on my LAN on the eth0 interface and i want wireless clients to be able to connect to the internet via a dhcp server(from the wlan0 interface)
the big question is do i need to bridge the two connections(both are on the same box remember!) or can i just forward the traffic to the wired conection using iptables or NAT(ill have use NAT anyway cause ill be using private addresses 192.168.0.0)
the wired connection will be 157.190.x.x(public address) will i need to forward to the public gateway ot just the ipaddress of my ethernet card and the rest takes care of it self
also how can i check to i have dhcp installed on the linux box i thought it came on it via default but i cant seem to find dhcpd at all
i know i have to rebuild the kernel if i need to bridge so im trying to avoid this if possible as i screwed it up last time and almost lost everything
cheers in advance!
I don't think briding will work for this application. If you used bridging you would be sending packets with a source address of 192.168.x.x out to the internet and you would never get a reply.
I think you need to enable packet forwarding and configure iptables to NAT the traffic.
ok would something like this work
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface wlan0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
- Enables packet forwarding by kernel
route add -net 192.168.1.0 netmask 255.255.255.0 gw XXX.XXX.XXX.XXX dev wlan0
Where XXX.XXX.XXX.XXX is the internet gateway defined by my LAN(not sure if this is my computer or the gateway of my computer!?)
so what do ye think am i missing anything at all!?
surely there is more or does that look right
ill be testing it 2morrow but wondering am i going about it the right way and if it works ill post up the config i used for it to be of benfit for others! :)
|All times are GMT -5. The time now is 02:32 AM.|