Linux - Wireless Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
06-01-2005, 10:32 PM
|
#1
|
Member
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860
Rep:
|
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.
|
|
|
06-02-2005, 02:05 AM
|
#2
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
06-02-2005, 11:27 AM
|
#3
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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.
|
|
|
06-04-2005, 08:29 PM
|
#4
|
Member
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860
Original Poster
Rep:
|
so if I do
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
(if eth1 is the one I'm using for wireless)
Then I just plug my winbox into the linbox through the NICs, right?
What else do I need to type and how often do I need to type it?
Thanks a bunch!
|
|
|
06-09-2005, 07:22 AM
|
#5
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
This is required..
echo 1 > /proc/sys/net/ipv4/ip_forward
You can do this after a reboot to check it..
cat /proc/sys/net/ipv4/ip_forward
If you see a 1 then it's set.
If not then put the echo command in /etc/rc.local
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.
|
|
|
All times are GMT -5. The time now is 05:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|