How to do IP Masquerading in kernel 2.4.7 ?

How to do IP Masquerading in kernel 2.4.7 ?

Post by Arctic Blizzar » Tue, 31 Jul 2001 10:42:14



I have RedHat 7.1, and I recently upgraded to kernel 2.4.7.
I would like to use this computer as an internet gateway for other
computers.
I went to this web site.
http://netfilter.filewatcher.org/unreliable-guides/NAT-HOWTO/NAT-HOWT...
doc.html#toc4
The section 4.1 says to type the following.

modprobe iptable_nat
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

When I typed the first command, I got an error, but I think that's because
when I compiled the kernel, I selected all the networking options as "Y",
not as modules.
The second and the third command did not give me errors.  There was no
response, so I guess the command was accepted.
However, it's not working.  When I revert to RedHat 6.2, and use IP chains,
everything works.
What did I do wrong?

--

I've used the NATO & International Aviation Phonetic Alphabet in my email
address, so the spammers'll have to work a bit harder.  Interestingly, in
Phonetic Alphabet, the letter "A" is represented by "Alfa", not "Alpha".
Anyway, if you're having trouble deciphering my cryptic email address, look
up "Phonetic Alphabet" on the web.  Sorry for the inconvenience.

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Arctic Blizzar » Tue, 31 Jul 2001 10:47:41


Quote:> I have RedHat 7.1, and I recently upgraded to kernel 2.4.7.
> I would like to use this computer as an internet gateway for other
> computers.
> I went to this web site.

http://netfilter.filewatcher.org/unreliable-guides/NAT-HOWTO/NAT-HOWT...

Quote:> doc.html#toc4
> The section 4.1 says to type the following.

> modprobe iptable_nat
> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward

> When I typed the first command, I got an error, but I think that's because
> when I compiled the kernel, I selected all the networking options as "Y",
> not as modules.
> The second and the third command did not give me errors.  There was no
> response, so I guess the command was accepted.
> However, it's not working.  When I revert to RedHat 6.2, and use IP
chains,
> everything works.
> What did I do wrong?

If the web site above gives you an error, try this address.
http://netfilter.filewatcher.org/unreliable-guides/NAT-HOWTO/index.html

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Skippy the Inter » Tue, 31 Jul 2001 10:57:09


: modprobe iptable_nat
: iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
: echo 1 > /proc/sys/net/ipv4/ip_forward

is ppp0 the interface you want packets to go out on?

--
Ben Garrison * cs1322 TA / ProgDev * www.bengarrison.net
\ Romans 8:38  For I am convinced that neither death nor life,
 \ nor angels nor demons, neither the present nor the future,
  \ nor any power...will be able to separate us from the love of Christ

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Joshua Gustafso » Tue, 31 Jul 2001 11:33:54


One odd thing I noticed when I upgraded to Red Hat 7.1 is that, by default,
the init.d scripts run both an ipchains and an iptables script.  The
ipchains script runs first, and itables doesn't seem to work after that.  I
disabled the ipchains script (renamed S08ipchains to K08ipchains in
/etc/rc3.d and /etc/rc5.d) and was then able to use iptables without a
hitch.  Maybe you're having a similar problem?

-Josh



Quote:> I have RedHat 7.1, and I recently upgraded to kernel 2.4.7.
> I would like to use this computer as an internet gateway for other
> computers.
> I went to this web site.

http://netfilter.filewatcher.org/unreliable-guides/NAT-HOWTO/NAT-HOWT...
> doc.html#toc4
> The section 4.1 says to type the following.

> modprobe iptable_nat
> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward

> When I typed the first command, I got an error, but I think that's because
> when I compiled the kernel, I selected all the networking options as "Y",
> not as modules.
> The second and the third command did not give me errors.  There was no
> response, so I guess the command was accepted.
> However, it's not working.  When I revert to RedHat 6.2, and use IP
chains,
> everything works.
> What did I do wrong?

> --

> I've used the NATO & International Aviation Phonetic Alphabet in my email
> address, so the spammers'll have to work a bit harder.  Interestingly, in
> Phonetic Alphabet, the letter "A" is represented by "Alfa", not "Alpha".
> Anyway, if you're having trouble deciphering my cryptic email address,
look
> up "Phonetic Alphabet" on the web.  Sorry for the inconvenience.

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Dean Thompso » Tue, 31 Jul 2001 14:30:35


Hi!,

Quote:> modprobe iptable_nat
> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward

> When I typed the first command, I got an error, but I think that's because
> when I compiled the kernel, I selected all the networking options as "Y",
> not as modules.
> The second and the third command did not give me errors.  There was no
> response, so I guess the command was accepted.
> However, it's not working.  When I revert to RedHat 6.2, and use IP chains,
> everything works.
> What did I do wrong?

Make sure you allow IP forwarding by modifying the /etc/sysctl.conf file so
that ip_forward has a value of one.  You will then either need to reboot the
machine or issue the "sysctl" command to inform the kernel that IP forwarding
has been activated.

See ya

Dean Thompson

--
+____________________________+____________________________________________+

| Bach. Computing (Hons)     | ICQ     - 45191180                         |
| PhD Student                | Office  - <Off-Campus>                     |
| School Comp.Sci & Soft.Eng | Phone   - +61 3 9903 2787 (Gen. Office)    |
| MONASH (Caulfield Campus)  | Fax     - +61 3 9903 1077                  |
| Melbourne, Australia       |                                            |
+----------------------------+--------------------------------------------+

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by marlbor » Tue, 31 Jul 2001 17:54:32


with ipchains, it's "ip_masq_ftp"



> In IPChains, does anything else have to be done to enable ftp access
> through the firewall?  I have loaded the ip_nat_ftp module, but it
> doesn't appear to make much difference.  I've even restarted IPChains.


>> > I'm not loading the proper module (which is now apparently
>> > ip_nat_ftp).

>> Apparently ? ip_nat_ftp belongs to iptables (which only works with
>> kernels
>> >= 2.4 and are slightly more comfortable). So you should check if you
>> >want
>> to use iptables or ipchains. Concerning your rules, I would guess
>> ipchains is the right choice...

>> To masqueraqde ftp, try

>> $ insmod ip_masq_ftp

>> (for use with ipchains). If you want to use iptables, try

>> $ insmod ip_nat_ftp

>> If you want to switch from ipchains to iptables, check
>> /etc/modules.conf and run depmod -a...

>> HTH, Hendrik

>> > My /etc/sysconfig/ipchains file contains the following rules Is
>> > ip_nat_ftp what I need? What am I doing wrong, or how may I fix this
>> > problem.

>> See above!

>> HTH,

>> Hendrik

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Arctic Blizzar » Wed, 01 Aug 2001 12:15:16


Quote:> : modprobe iptable_nat
> : iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> : echo 1 > /proc/sys/net/ipv4/ip_forward

> is ppp0 the interface you want packets to go out on?

Yes.  The Linux computer connect to the internet via a 56k modem.
 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Arctic Blizzar » Wed, 01 Aug 2001 12:38:59


Quote:> > modprobe iptable_nat
> > iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> > echo 1 > /proc/sys/net/ipv4/ip_forward

> > When I typed the first command, I got an error, but I think that's
because
> > when I compiled the kernel, I selected all the networking options as
"Y",
> > not as modules.
> > The second and the third command did not give me errors.  There was no
> > response, so I guess the command was accepted.
> > However, it's not working.  When I revert to RedHat 6.2, and use IP
chains,
> > everything works.
> > What did I do wrong?

> Make sure you allow IP forwarding by modifying the /etc/sysctl.conf file
so
> that ip_forward has a value of one.  You will then either need to reboot
the
> machine or issue the "sysctl" command to inform the kernel that IP
forwarding
> has been activated.

My setup works for IP chains.
The /etc/sysctl.conf file has the following lines.

net.ipv4.ip_forward = 1
net.ipv4.ip_always_defrag = 1
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq =

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Lord Apollyo » Wed, 01 Aug 2001 14:56:13





> My setup works for IP chains.
> The /etc/sysctl.conf file has the following lines.

> net.ipv4.ip_forward = 1
> net.ipv4.ip_always_defrag = 1
> net.ipv4.conf.all.rp_filter = 1

Didn't ip_always_defrag go away in 2.4.x?

=R=

--
The reply-to-address is *REAL* and will expire on 0:01 1-August-2001.
 >>  HTML emails will be bounced UNREAD.  You've been warned.  <<
 >>  Some ISPs are blacklisted due to rampant network abuse.   <<
Please review http://www2.paypc.com/blacklists/ before emailing.

 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Arctic Blizzar » Thu, 02 Aug 2001 10:09:16


Quote:> > My setup works for IP chains.
> > The /etc/sysctl.conf file has the following lines.

> > net.ipv4.ip_forward = 1
> > net.ipv4.ip_always_defrag = 1
> > net.ipv4.conf.all.rp_filter = 1

> Didn't ip_always_defrag go away in 2.4.x?

Hey, it worked!
I commented out the following line.
# net.ipv4.ip_always_defrag = 1
And now, everything is working great!
Thanks.
 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by Arctic Blizzar » Thu, 02 Aug 2001 11:36:12


Quote:> > > My setup works for IP chains.
> > > The /etc/sysctl.conf file has the following lines.

> > > net.ipv4.ip_forward = 1
> > > net.ipv4.ip_always_defrag = 1
> > > net.ipv4.conf.all.rp_filter = 1

> > Didn't ip_always_defrag go away in 2.4.x?

> Hey, it worked!
> I commented out the following line.
> # net.ipv4.ip_always_defrag = 1
> And now, everything is working great!
> Thanks.

Ummm,... on second thought,...  I don't think that the problem was with
defrag,...
I may have typed the following wrong.
iptables -t nat -A POSTROUTING -o pppO -j MASQUERADE
For ppp0, instead of typing "ppp" and zero, I may have typed "ppp" and the
letter O.
Oops!
--
 
 
 

How to do IP Masquerading in kernel 2.4.7 ?

Post by <WaterD.. » Fri, 03 Aug 2001 22:30:14


Note that on RedHat 7.1 ipchains automatically start.  IP-Tables will not
run with ipchains running.  I believe to turn off ipchains you should
issue the command:  chkconfig --level 2345 ipchains off    Then issue the
command:  chkconfig --level 2345 iptables on  Then issue the command:  
service network restart  Also, someone else mentioned it, but are you
using ppp0 or are you using a NIC?  If you are using a nic then most
likely change ppp0 to eth0.

Glenn
LCA


> I have RedHat 7.1, and I recently upgraded to kernel 2.4.7.
> I would like to use this computer as an internet gateway for other
> computers.
> I went to this web site.
> http://netfilter.filewatcher.org/unreliable-guides/NAT-HOWTO/NAT-
HOWTO.linux
> doc.html#toc4
> The section 4.1 says to type the following.

> modprobe iptable_nat
> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward

> When I typed the first command, I got an error, but I think that's
because
> when I compiled the kernel, I selected all the networking options as "Y",
> not as modules.
> The second and the third command did not give me errors.  There was no
> response, so I guess the command was accepted.
> However, it's not working.  When I revert to RedHat 6.2, and use IP
chains,
> everything works.
> What did I do wrong?

> --

> I've used the NATO & International Aviation Phonetic Alphabet in my email
> address, so the spammers'll have to work a bit harder.  Interestingly, in
> Phonetic Alphabet, the letter "A" is represented by "Alfa", not "Alpha".
> Anyway, if you're having trouble deciphering my cryptic email address,
look
> up "Phonetic Alphabet" on the web.  Sorry for the inconvenience.

--
Posted via CNET Help.com
http://www.help.com/
 
 
 

1. IP for masqueraded net other than masquerading host IP

Hello

I have a linux box which should work as router for two subnets to the internet.
One subnet has valid IP addresses but the other subnet with private IPs has to be masqueraded. Is it possible to masquerade this subnet with an IP address from the other subnet or with the IP of the router port which is connected to the valid subnet and not with the IP address of the router port which is connected to the internet which is the default?

regards
Klaus

2. Sorry! Set user id

3. Kernel versions, IP firewalls, IP masquerading and stability

4. JIT with kaffe

5. Ip-Masquerade and games over the net...what am I doing wrong????????

6. FreeBSD 4.4 newbie install...hangs on "hardware probe"

7. After IP Masquerade done ??

8. Rewrite rule

9. Ip-Masquerade and games over the net...what am I doing wrong????????

10. IP Masquerading works, but does not masquerade from within the local network

11. IP MASQuerading NOT Masquerading?

12. Linux IP and VPN masquerading with 2.6.x kernels