I have an ubnutu server connected to internet by an ethernet cable to a router. I would like to share the Internet connection by a Wifi usb dongle connected to the server.
What are the possible ways to setup the server as a wifi access point?
The router is running a dhcp server, and I would like that wifi clients get their ip directly from the router without any "routing" in the ubuntu box.
So, you basically want your Ubuntu box to act as a repeater or media converter, otherwise known as a bridge. Try adding something like this to
/etc/network/interfaces
:Note: you'll need to have the
bridge-utils
package installed.You will need to run your WiFi interface in Ad-Hoc or AP mode. Read http://www.linux.com/archive/articles/55617 for a fine introduction to wireless access point configuration under Linux, including securing and bridging. Note that not every chipset can run in AP mode, so your mileage may vary.
I am quite sure it is not possible for clients to get IPs from router without "any" routing in ububtu box. The box will not route traffic from WiFi to LAN and back all by itself.
You can bridge the ethernet interface and wi-fi interface, and all the traffic will pass unmodified. Your router will see DHCP requests from wireless clients and answer them.
You will need an extra interface for the machine itself tough. Or you can look for tricks that will leave the bridged interface usable by the machine as a normal ethernet interface.