Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
 |
08-04-2005, 02:49 AM
|
#1
|
LQ Newbie
Registered: Apr 2005
Location: Brussels, Belgium
Distribution: Gentoo
Posts: 17
Rep:
|
NAT forwarding
Hey
I have two computeres here in my room, but only one wireless card
We have a wireless network and the base station is downstairs and handles the internet. I want get the computer here in my room wihtout a wireless card to connect to the whole network..... Can i do it with NAT forwarding in iptables?
on the box with both connections
wlan0
inet 192.168.1.3
eth0
inet 192.168.0.2
on the other one
eth0
inet 192.168.0.1
ive got a crossover cable running between them...
is this possible to do?
how do i do it?
thanks
|
|
|
08-04-2005, 03:04 AM
|
#2
|
Member
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208
Rep:
|
do nat on the box with both connection
#/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.1 -o wlan0 -j MASQUERADE
#service iptables save
then give the gateway 192.168.0.2 in the other box.
DNS address remains the same.
then do ip forwarding
#cd /etc
#vi sysctl.conf
net.ipv4.ip_forward = 0
make it to 1 and save and exit
then
#/sbin/sysctl -p
Last edited by roopunix; 08-04-2005 at 03:08 AM.
|
|
|
08-04-2005, 03:10 AM
|
#3
|
Senior Member
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380
Rep:
|
Install and setup ip-masquerading on the box with the wireless lan connection and then tell the cabled box to use the wireless box as the gateway. Some more info on iptables configuration here .
|
|
|
08-04-2005, 03:12 AM
|
#4
|
LQ Newbie
Registered: Apr 2005
Location: Brussels, Belgium
Distribution: Gentoo
Posts: 17
Original Poster
Rep:
|
worked great thanks
|
|
|
08-04-2005, 03:26 AM
|
#5
|
Member
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940
Rep:
|
you could do bridging... that means that both your wlan0 and your eth0 devices are 'bridged' to br0, br0 gets the ip address assigne, and you set ip frowarding ('echo 1 > /proc/sys/net/ipv4/ip_forward')
then your 2nd (not wireless enabled) computer gets the ip address assigend from your accesspoint, or other router, and your first pc acts like a switch (in this case like a wireless accesspoint).
you can still use iptables to secure the entire setup.
|
|
|
All times are GMT -5. The time now is 03:17 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
|
|