Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-04-2005, 02:49 AM   #1
LQ Newbie
Registered: Apr 2005
Location: Brussels, Belgium
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
NAT forwarding


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


on the other one

ive got a crossover cable running between them...

is this possible to do?
how do i do it?

Old 08-04-2005, 03:04 AM   #2
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
do nat on the box with both connection

#/sbin/iptables -t nat -A POSTROUTING -s -o wlan0 -j MASQUERADE
#service iptables save

then give the gateway 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
#/sbin/sysctl -p

Last edited by roopunix; 08-04-2005 at 03:08 AM.
Old 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: Reputation: 49
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 .
Old 08-04-2005, 03:12 AM   #4
LQ Newbie
Registered: Apr 2005
Location: Brussels, Belgium
Distribution: Gentoo
Posts: 17

Original Poster
Rep: Reputation: 0
worked great thanks
Old 08-04-2005, 03:26 AM   #5
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
NAT and Port Forwarding aq_mishu Linux - Networking 2 09-16-2005 07:58 AM
NAT forwarding FTP ports Ossar Linux - Networking 4 03-14-2005 12:07 PM
Port Forwarding without NAT on an old Kernel linuxpyro Linux - Networking 0 06-02-2004 12:31 PM
NAT Port forwarding problems! nidputerguy Linux - Networking 4 01-31-2004 10:29 AM
bizarre nat forwarding problem ignorantliwong Linux - Networking 1 09-04-2003 10:12 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration