help with IP masquerading

mindless

Senior member
Oct 9, 1999
661
0
0
I have been dualbooting between Win2k and Redhat 7 for the past few months because I didn't have connection sharing and never got around to setting it up. Ive started to set it up and I am partially successful, from my LAN I can ping my IP assigned with my dialup, but no further. I have no problems accessing the net from my Linux box so its not my connection. Here is my /etc/rc.d/rc.firewall file:

#!/bin/sh

/sbin/depmod -a

/sbin/modprobe ip_masq_ftp

echo "1" > /proc/sys/net/ipv5/ip_forward

/sbin/ipchains -M -S 7200 10 160

#RULESET
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -i eth0 -s 192.168.0.0/24 -j MASQ

------EOF------

I have also used the sample at

http://linuxdocs.org/HOWTOs/IP-Masquerade-HOWTO-3.html#ss3.3

And uncommented out the line for dynamic IP connections. I had the same results with each of the rc.firewall files.

My Linux box has an IP of 192.168.0.1, the system I am trying to share it with has an IP of 192.168.0.3 and a default gateway of 192.168.0.1

Please be gentle, I am only a Linux newbie who hopes one day to be worthy of the Tux.

Thanks,
Kevin
 

SteveMazza

Member
Nov 27, 2000
27
0
0
If you get IP dynamically, then you will also have to compile support for that as per IP-MASQ how-to. Basically, ensure that you have selected all the options appropriate to your kernel (version???) installed the simplest set of forwarding rules possible (looks like you have).

By the way, my rules look like this:
:input ACCEPT
:forward DENY
: output ACCEPT (damn emoticons)
-A forward -s 192.168.1.0/24 -d 0.0.0.0/0.0.0.0 -i eth0 -j MASQ

Works just peachy. Again, check the kernel options in your compile.
 

mindless

Senior member
Oct 9, 1999
661
0
0
<mindless goes and hides in a corner away from those telling him he needs to recompile the kernel>

ahh well I have to do it anyway for NTFS support

Thanks
 

mindless

Senior member
Oct 9, 1999
661
0
0
I managed to get the sharing to work but I had to set my default forwarding policy to MASQ which the manual on linuxdocs.org says not to do. Here is my ruleset:

/sbin/ipchains -P forward MASQ
/sbin/ipchains -A forward -i eth0 -s 192.168.0.0/24 -j MASQ

I am going to assume that this is a bad thing but I would like to know what I am doing wrong since I can't seem to get it working if the default is set to DENY
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
ichains -A forward -s 192.168.1.0/24 -d 0.0.0.0/0.0.0.0 -i eth0 -j MASQ

Because that's the line you want, not what you're using. Your line missed the destination.
 

andri

Senior member
Aug 12, 2000
339
0
0
To wrap everything up, IP masquerading in Linux can be done in three easy steps:

1) echo &quot;1&quot; > /proc/sys/net/ipv4/ip_forward
2) /sbin/ipchains -P forward DENY
3) /sbin/ipchains -s 192.168.0.0/255.255.255.0 -d 0.0.0.0/0.0.0.0 -j MASQ

Replace 192.168.0.0/255.255.255.0 with what you used in your internal network.
 

mindless

Senior member
Oct 9, 1999
661
0
0
Thanks guys, it works, but I had to change it to

ichains -A forward -s 192.168.1.0/24 -d 0.0.0.0/0.0.0.0 -j MASQ

I am going to assume the -i tells it where to forward the packets to so they were just coming back to my network instead of going to the net. I can't get over how much I like Linux Now if only there was a decent browser for it....
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |