Can my linux computer be a router AND a regular computer?
Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can my linux computer be a router AND a regular computer?
I've had to switch to a location where my internet connection is provided only by wireless. Instead of buying two wireless cards (or usb wireless) can I just connect the wireless adapter to the Linux computer, connect the linux computer to a wired router, and connect another computer to the router to share the internet connection? I know this can be done when the Linux computer is just a router, but can it work and still function as a regular Linux PC?
If it can be done, would you be able to point me in the direction of an explanation? So far I was mostly able to find stuff relating to having the computer simply function as a router.
As far as configuring the NAT for internet sharing, it shouldn't be any different then if you were doing the same for two NIC interfaces. The name of the interface may be different, wlan0 instead of eth0. If you got the wireless communicating with the internet service, the hardest work may be done. If FC3 has a configuration program for internet sharing, try that first.
Set the machine up as a nat router. Then just use it normally.
The howto's that show you how to setup a router are the correct ones to use.
Basically all you need to do is enable ipforwarding and ip masquerade.
This should be found in the network configuration gui if your using that. If not then it's a matter of setting ip_forward to 1 and entering the ip masquerade iptables command and do `service iptables save`
don't forget to set this at every boot..
echo 1 > /proc/sys/net/ipv4/ip_forward
Very basic rule would look like this...
/sbin/iptables -t nat -A POSTROUTING -o <Interface> -j MASQUERADE
In your case the output interface would be the wireless device
Last edited by DavidPhillips; 06-02-2005 at 11:42 AM.
Once your iptables rules are set the way you need them run this command..
service iptables save
The saved rules will be applied on reboot.
Plugging in your other computers will not get the network going unless you have dhcp enabled on all computers and a server on the network (could be the same machine if you want a DHCP server on your LAN), or you can have static ip addresses and DNS manually configured.
If the linux box is going to be the DHCP server setup it's LAN interface with a static ip, configure the DHCP server for that LAN's network, make it the router in your DHCP config, and setup the DNS servers in you DHCP config.
Last edited by DavidPhillips; 06-09-2005 at 07:36 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.