From 03b85ded5b2c395275a112c18d8ebbe7ecde1606 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 3 May 2007 03:32:40 +0000 Subject: Show common commands in the php pfsense shell such as: * Enabling SSH * Enabling wireless on an interface (hostap, channel, ssid, etc) * Enabling DHCP Server on an interface * Disable firewall filter * Set up an interface for DHCP and enable * Set up an interface for static and enable These commands come in handy when configuring a 1 port ethernet wrap with 2 wireless cards. Sponsored-by: Bluegrass.net --- usr/local/sbin/pfSsh.php | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'usr') diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index 885e38e..5d8f31a 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -21,10 +21,37 @@ $shell_active = true; echo "Example commands:\n\n"; echo " print_r(\$config);\n"; -echo " \$config['interfaces']['lan']['ipaddr'] = \"192.168.1.1\";\n"; -echo " write_config();\n"; -echo " multiline\n"; -echo " exit"; + +echo "\n/* to enable SSH */\n"; +echo "\$config['system']['enablesshd'] = true;\n"; + +echo "multiline\n"; +echo "exit\n"; + +echo "\n/* change OPTX to the OPT interface name such as BACKHAUL */\n"; +echo "\$config['interfaces']['optx']['wireless']['standard'] = \"11a\";\n"; +echo "\$config['interfaces']['optx']['wireless']['mode'] = \"hostap\";\n"; +echo "\$config['interfaces']['optx']['wireless']['channel'] = \"6\";\n"; + +echo "\n/* to enable server */\n"; +echo "\$config['dhcpd']['optx']['enable'] = true;\n"; +echo "\$config['dhcpd']['optx']['range']['from'] = \"192.168.31.100\";\n"; +echo "\$config['dhcpd']['optx']['range']['to'] = \"192.168.31.150\";\n"; + +echo "\n/* to disable the firewall filter */\n"; +echo "\$config['system']['disablefilter'] = true;\n"; + +echo "\n/* to enable an interface and set it for dhcp */\n"; +echo "\$config['interfaces']['optx']['disabled'] = false;\n"; +echo "\$config['interfaces']['optx']['ipaddr'] = \"dhcp\";\n"; + +echo "\n/* to enable an interface and set a static ip address */\n"; +echo "\$config['interfaces']['wan']['disabled'] = false;\n"; +echo "\$config['interfaces']['wan']['ipaddr'] = \"192.168.100.1\";\n"; +echo "\$config['interfaces']['wan']['subnet'] = \"24\";\n"; + +echo "/* to save out the new configuration (config.xml) */\n"; +echo "write_config();\n"; while($shell_active == true) { echo "\n\npfSense shell> "; -- cgit v1.1