LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 06-05-2005, 10:48 AM   #1
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Rep: Reputation: 37
What exactly do I do for Ip Masquerading?


According to a tutorial I found that I should type:

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? In other words, is this always active or do I have to type in some command every boot in order to get it to work?

Basically I'm trying to share my wireless internet connection with my Windows PC through their NICs.

Thanks a bunch!
 
Old 06-05-2005, 12:37 PM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
apart from Ip masquearding u need to enable
ip forwarding
look for that variable in /etc/sysctl.conf file

also u can make some rules in a iptables in a script and execute that

regards
 
Old 06-06-2005, 05:27 PM   #3
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
Here's what I did:

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

service iptables save

went into sysctl.conf and changed IPforwarding to 1

plugged in Windows NIC to Linux NIC....nothing happened.

Output of iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

and iptables file:

# Generated by iptables-save v1.2.11 on Mon Jun 6 18:20:17 2005
*filter
:INPUT ACCEPT [514:304282]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [524:37755]
COMMIT
# Completed on Mon Jun 6 18:20:17 2005
# Generated by iptables-save v1.2.11 on Mon Jun 6 18:20:17 2005
*nat
:PREROUTING ACCEPT [2:259]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [13:751]
-A POSTROUTING -o eth1 -j MASQUERADE
-A POSTROUTING -o eth1 -j MASQUERADE
-A POSTROUTING -o eth1 -j MASQUERADE
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Mon Jun 6 18:20:17 2005

Any ideas?

Thanks
 
Old 06-06-2005, 05:29 PM   #4
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
output of iptables -t nat -L

Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere
MASQUERADE all -- anywhere anywhere
MASQUERADE all -- anywhere anywhere
MASQUERADE all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
Old 06-06-2005, 05:37 PM   #5
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
also tried service iptables restart
 
Old 06-07-2005, 01:21 AM   #6
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
did u ad this machine as ur gatway ans a DNS adresss in the windows machine

regards
 
Old 06-07-2005, 09:03 PM   #7
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
nope. Looking into that.
 
Old 06-07-2005, 09:19 PM   #8
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
I tried changing it without any luck. Here's what I did:

ifconfig eth0 192.168.10.101 netmask 255.255.255.0 broadcast 192.168.10.255

then in Windows:

IP address - 192.168.10.101
Subnet mask: 255.255.255.0
Default Gateway: 192.168.10.101
 
Old 06-07-2005, 09:35 PM   #9
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
Did you run "sysctl -p"? What can you ping from the windows comp (can you reach the linux comp, the internet?). Also why on the windows is the gateway same as the ip?
 
Old 06-08-2005, 08:02 AM   #10
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
what do u get in windows for

ipconfig

and

traceroute <ip address>

regards
 
Old 06-08-2005, 04:56 PM   #11
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
in windows it complains that the nic is not connected
 
Old 06-08-2005, 11:34 PM   #12
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
Quote:
Originally posted by DJOtaku
in windows it complains that the nic is not connected
not connected??

can u ping that linux machine from win machine and is the cable correct

regards
 
Old 06-09-2005, 09:13 PM   #13
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
1) which address would I ping? The address of the NIC?

2) Yeah, the little icon in the systray shows the two computers and a red "X" meaning the computer thinks it's not plugged in.
 
Old 06-10-2005, 03:24 AM   #14
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
so is that a problem of ur hardware?

u need to get that right then only u can go with ip masquerading

regards
 
  


Reply



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
IP Masquerading ? emailssent Linux - Networking 1 10-07-2004 10:49 PM
help ip masquerading campusloop Linux - Networking 1 05-20-2004 12:37 PM
IP masquerading. somebody help me! Johnsernickle Linux - Networking 4 10-22-2002 06:57 PM
IP Masquerading kwigibo Linux - Networking 3 09-21-2002 07:46 PM
ip masquerading artman62 Linux - Security 5 08-13-2002 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 02:11 AM.

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