Re: Configuring interfaces through php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 24, 2008 at 12:36 AM, Heysem Kaya
<heysem.kaya@xxxxxxxxxxxxxxx>wrote:

>   Hi Nathan,
>
> Thanks for your response. Is there such a way to reconfigure the interface
> IP,dns and gateway as well?
>

please keep responses on-list, so that others may benefit.

yes, you can do anything (almost?) you can on the cli w/ those exec family
of calls.  so, basic *nix stuff, sprinkled w/ some php if you want to have
more dynamic code..

...
$ifconfigUpOutput = shell_exec("/sbin/ifconfig $interface netmask $netmask
broadcast $broadcast up");
$defaultRoute = shell_exec("route add default gw $defaultGw");
file_put_contents('/etc/resolv.conf', $nameserList);
...

something to that effect.  just bear in mind what could happen if network
connectivity doesnt come back up, etc, etc.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux