Correct me everyone if I`m wrong:

1. First - you have to get your assigned IP number ... you can do it by
"extracting" it from ifconfig message - after connecting to PPP server.
Practically you can achieve this by adding following line to your
rc.firewall script:

extip="`/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed
-e 's/.*://'`"

and after that in your iptables rulesets you can use $extip as your
external IP number.

2. Now you have to "restart" rc.firewall script every time you start
your ppp connection. /etc/ppp/ip-up is the script which is always
executed after you`re connected so you simply have to add a line to it
at the begining containing:
/etc/rc.d/rc.firewall 

(but of course after #!/bin/bash ;-) )

If you don't already have a /etc/ppp/ip-up sccript, you need to create
the  following link to run the /etc/rc.d/rc.firewall script.

ln -s /etc/rc.d/rc.firewall /etc/ppp/ip-up

If any doubt read Linux IP Masquerade HOWTO, Chapter 6. "Other IP
Masquerade Issues and Software Support".

I hope that this will help you

Best Regards

Szymon


19-08-2002, godz. 23:03, Jose Romildo Malaquias wrote: 

> Hello.
> 
> I connect to the internet with a cable modem using the PPPoE
> protocol. I am in the process of configuring IP Masquerading
> in my internal network, using my Red Hat Linux 7.3 box
> as the gateway (IP MASQ server). I am following the IP
> Masquerading HOWTO, but I am having some difficult in setting
> the stronger ruleset for IPTABLE.
> 
> I am noticing that the IP address I receive is not constant,
> but change even after connected to the internet. As the ruleset
> used with IPTABLE depends on this IP address, I suppose I
> have to rerun the IPTABLE ruleset after each time
> I get a new IP address. I have a /etc/rc.d/rc.firewall
> script used to set the IPTABLE ruleset, and it should be
> run every time I receive a new IP address.
> 
> Attached is an excerpt from the /var/log/messages
> file (with uninteresting lines deleted) demonstrating
> the changing IP addresses.
> 
> What is the correct (best) way of accomplishing this with
> RHL 7.3?
> 
> Regards,
> 
> Romildo
> 
> -- 
> Prof. José Romildo Malaquias
> Departamento de Computação - Universidade Federal de Ouro Preto
> http://www.decom.ufop.br/prof/romildo/        [EMAIL PROTECTED]
> http://uber.com.br/romildo/           [EMAIL PROTECTED]
> 



---------------------------------------------------------------------------
You received this letter from:

Szymon Lukasik
Cracow Univ. Of Technology Student
Linux Registered User #283292
e-mail: [EMAIL PROTECTED]
www:    www.szymonl.republika.pl
gg:     1925326
---------------------------------------------------------------------------



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to