LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-16-2005, 02:08 AM   #1
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Rep: Reputation: 30
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
 
Old 11-16-2005, 03:55 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
No, use /etc/ppp/ip-up.local and create it with execution permissions if it does not exist.
 
Old 11-16-2005, 06:09 PM   #3
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
hey, wait a minute, i dun have the /etc/ppp/ip-up.local file??? can u please explain in more details? thanks
 
Old 11-16-2005, 06:23 PM   #4
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
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.
 
Old 11-16-2005, 06:41 PM   #5
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
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
 
Old 11-16-2005, 06:56 PM   #6
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
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
 
Old 11-16-2005, 07:07 PM   #7
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
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.
 
Old 11-16-2005, 07:15 PM   #8
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
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.
 
Old 11-16-2005, 07:20 PM   #9
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
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???
 
Old 11-16-2005, 07:41 PM   #10
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
no ifup command Present Slackware 10 03-02-2005 10:21 AM
where is my ifup/down? syreth Slackware 4 09-13-2004 08:06 AM
ifup-lo recovery ehawk Linux - Networking 0 06-23-2004 04:19 AM
i dont have 'ifup' true_atlantis Slackware 1 05-20-2004 04:59 AM
eth0 ifup warmongr Linux - Networking 2 04-29-2004 04:00 PM

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

All times are GMT -5. The time now is 01:57 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