LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-03-2013, 11:26 AM   #1
shams
Member
 
Registered: Jan 2004
Posts: 535

Rep: Reputation: 30
How to replace old ip with new ip in ipsec.conf?


I have dialup connection with dynamic ip address, i want to replace the old ip address with the new ip address in the ipsec.conf which is in the 18th line:
Quote:
left=118.23.67.21
This is a code the print the new external ip address with each dialup connection:
Quote:
EXTIF="ppp0"
IFCONFIG=/sbin/ifconfig
AWK=/usr/bin/awk
EXTIP="`$IFCONFIG $EXTIF 2>/dev/null | $AWK \
/$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"
echo "$EXTIP"
how to use a code with one of cat, echo or sed commands to replace the above line with the ouput of this new ip address?

Last edited by shams; 02-03-2013 at 08:36 PM.
 
Old 02-03-2013, 11:33 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hey there, if I'm not mistaken, just entering this should work

Quote:
su -
(password you the Root, or your password, if you're in the sudorers)
nano /pathto/ipsec.conf
and edit, save and you're done...

Just a suggestion

Thor
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vpn-ipsec : Failed to parse config setup portion of ipsec.conf hari85 Linux - Newbie 1 07-17-2010 08:12 PM
OpenSwan ipsec - conf,check -I need help hotsouce Linux - Networking 1 08-25-2008 03:54 AM
OpenSwan ipsec - conf,check -I need help hotsouce Linux - Networking 3 08-22-2008 12:07 AM
[OpenBSD 3.8] /etc/ipsec.conf not present noir911 *BSD 1 03-23-2006 03:10 PM
My sysctl.conf. what I need to make VPN over IPSEC ? sergiodemoura Debian 1 02-08-2004 02:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:34 PM.

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