LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   PPP server IP ??? (https://www.linuxquestions.org/questions/linux-networking-3/ppp-server-ip-545356/)

culin 04-12-2007 02:06 AM

PPP server IP ???
 
Hi all ,
can anyone tell me how to determine the client IP and the server IP when i run PPP client on my PC..... does the ifconfig output gives both the client and server IP ?? if yes then how to extract the server IP and client IP from that output (say while coding) ???
thanks :)

wjevans_7d1@yahoo.co 04-12-2007 09:27 PM

A clumsy but simple way is to do this:

Code:

if(system("/sbin/ifconfig ppp0 > somescratchfile"))
{
  ... put error handling code here ...
}

... and then look at that scratch file. The data you're looking for will be obvious in the output. It takes no sophisticated code to read it.

A tighter alternative is to use ioctl() instead of system().

Has that W. Richard Stevens book arrived at your bookseller yet? It will explain all this in detail.

culin 04-13-2007 02:20 AM

thanks for reply, :)
what i am doing is ifconfig -a which shows the all the interfaces that are up,
but the weired thing happening here is ... ifconfig -a shows the ppp0 link is up and packets goes on increasing with time....but it is not showing any IP address or anything even though the link is up !!!!! :( :( and i checked by coming out from the LAN and brought down all the interfaces.. even then it is not showing the ip address. .. i tried using ioctl() but it is showing IP address for the interface eth0 but not for ppp0 even though the link is up :( and it is showing one more interface sit0 what is that ???

wjevans_7d1@yahoo.co 04-13-2007 03:19 PM

It would be a great idea to do five things.

Thing one: bring ppp up.

Thing two: do this ...

Code:

/sbin/ifconfig -a > file1.txt
Thing three: bring ppp down.

Thing four: do this ...

Code:

/sbin/ifconfig -a > file2.txt
Thing five: post in this thread the entire content of file1.txt and file2.txt.

nirmaltom 04-13-2007 03:59 PM

hi,

sit stands for "simple internet transition" and is basically a device
capable of encapsulating ipv6 in ipv4 datagrams.

regards,
Nirmal Tom.

wjevans_7d1@yahoo.co 04-14-2007 07:26 AM

Thanks, Nirmal. I had no idea. I learn something new just about every day around here.

Now we get to sit back and wait for culin's response. (grin)


All times are GMT -5. The time now is 10:09 AM.