Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-16-2005, 02:08 AM
|
#1
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Rep:
|
ifup??
hi,
i want to load some iptables rules dynamically when ppp0 is up(which is connected to the internet). what is the script triggering the ppp0? /etc/sysconfig/network-script/ifup? i tried it but, it shows no response. (FYI, i am using FC2). thanks
|
|
|
11-16-2005, 03:55 AM
|
#2
|
Member
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666
Rep:
|
No, use /etc/ppp/ip-up.local and create it with execution permissions if it does not exist.
|
|
|
11-16-2005, 06:09 PM
|
#3
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
hey, wait a minute, i dun have the /etc/ppp/ip-up.local file??? can u please explain in more details? thanks
|
|
|
11-16-2005, 06:23 PM
|
#4
|
Member
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666
Rep:
|
The only file you should have is /etc/ppp/ip-up. It is an executable script which runs whenever a new ppp interface is being up. Some part of this script checks for the file /etc/ppp/ip-up.local. If it exist and has execution permissions, ip-up will run it as well. Probably, it works not on all distros, but RH, as I think, cannot do not have it 
Indeed you can write all you need in tag of ip-up but it is not right, this script will be replaced with a new one on package updating.
|
|
|
11-16-2005, 06:41 PM
|
#5
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
so,
i have to create a /etc/ppp/ip-up.local file
cp ~/firewall-rules /etc/ppp/ip-up.local
chmod +x /etc/ppp/ip-up.local
i have to put all my iptables rules to /etc/ppp/ip-up.local?
it will load dynamically after ppp0 is established, or after it is redailed for making another new connection?
am i right??? thanks
|
|
|
11-16-2005, 06:56 PM
|
#6
|
Member
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666
Rep:
|
Yes, you are completely right.
Quote:
Originally posted by yenonn
it will load dynamically after ppp0 is established, or after it is redailed for making another new connection?
|
I do not understand the question. The script will be run whenever ppp0 appear in the ifconfig's output 
|
|
|
11-16-2005, 07:07 PM
|
#7
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
i have a ppp0, and i want to apply firewall script, but then, the ppp0 will not permenantly grabing an ip for a long period. it will somehow reconnect the link to make a new connection and having another new ip. but, my firewall script needs to grab the ip dynamically (to sense the public ip address) and load it after it make a new connection. my intention is to make a dynamic firewall rules against the ppp0.
Last edited by yenonn; 11-16-2005 at 07:08 PM.
|
|
|
11-16-2005, 07:15 PM
|
#8
|
Member
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666
Rep:
|
ip-up script exports variables like PPP_REMOTE and PPP_LOCAL. If they should be changed (on reconnection, as you said), this script will be rerun.
|
|
|
11-16-2005, 07:20 PM
|
#9
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
thanks..... i like it very much.....
btw, do we need to learn shell script in order to understand what is the script is talking about???
|
|
|
11-16-2005, 07:41 PM
|
#10
|
Member
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666
Rep:
|
Quote:
Originally posted by yenonn
btw, do we need to learn shell script in order to understand what is the script is talking about???
|
Is it a question? 
|
|
|
All times are GMT -5. The time now is 01:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|