Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 02-03-2013, 11:26 AM   #1
Registered: Jan 2004
Posts: 450

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:
This is a code the print the new external ip address with each dialup connection:
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
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

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

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



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 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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration