$Id: README,v 1.11 2004/10/21 03:25:53 forys Exp $ When connecting to a network, we often bring up IP over our phone line or set up a VPN tunnel. Once immersed in the project of the day, it's easy to forget whether the network is currently up or down. What we wanted was easy way to bring an interface up or down, as well as a continuous visual reminder of our network state. Xnetintf can be used to manage any network interface (SLIP, PPP, Tunnel, Ethernet, etc). It also allows for interface-specific commands to be run after the state change completes (e.g. setting the clock to some remote host or running mail queues). The manual page gives a full description of it's features and how to use them. Here is just a short summary: o current interface state described through series of bitmaps. o mouse click on window initiates toggle of interface state. o per-interface configuration file to specify commands to bring interface up / down, as well as a command (e.g. a shell script) to run after the state change has been completed. o companion program -- ifsuex -- which permits safe root execution of an interface-specific command (like a stripped-down sudo). o command line interface (i.e. can be run without X Windows). To build and install "xnetintf", unpack the distribution, change to the "xnetintf" directory and type the following: xmkmf make make install make install.man alternately, you might try: cc -O -I xnetintf.c Netintf.c ifops.c cmdline.c -o xnetintf \ -L -lXaw -lXmu -lXt -lXext -lX11 cc -O ifsuex.c -o ifsuex The file "ifppp.conf" contains an example configuration file for a PPP interface. Instructions for customizing this file are included in the manual page "xnetintf.man". To control multiple interfaces, create separate configuration files -- one for each interface -- containing the 5 commands (up/check/post-up/down/post-down). Additionally, you may wish to install an X Windows "application defaults" file; "XNetintf.ad" contains an example. If you wish to use ifsuex, "ifsuex.conf" contains an example configuration file and the "ifsuex.man" manual page provides instructions. Since this configuration file permits a user to run a specified command as another user (usually root), be sure that the file and the path to it are sufficiently protected... and do *not* add a "-f configfile" option to "ifsuex", no matter how useful you think it might be! Xnetintf and ifsuex has been tested on the following operating systems: AIX 4.1 AT&T SysVR4, SysVR4.2 FreeBSD 2.1, 4.5, 4.10 HP-UX 9.5, 10.1, 11.11 Irix 5.3 Linux 2.4 NetBSD 1.5 OpenBSD 3.0 SunOS 4.1, 5.4, 5.8 Xnetintf really only requires X Windows and an operating system that supports the SIOCGIFFLAGS ioctl() on sockets. There's a good chance it will work for you. If "ifsuex.c" fails to link, check the source file; it's likely that one of the #define's at the top of the file needs to be undefined. Alternately, you might consider installing the sudo package from: ftp://ftp.cs.colorado.edu/pub/sudo http://freshmeat.net/projects/sudo Depending on how you configure X11 and your local network, you may find that X Windows will lock up after you bring an interface down. This is because your $DISPLAY is set to the address of the down'd interface. If, like me, you use your host name in $DISPLAY (and "127.0.0.1:0" is not an option), you can still make this work: [ifconfig/route done once at system startup] ifconfig ppp0 inet [...] down route add default [click on icon: bring network interface up] [click on icon: bring network interface down] [run after interface comes down to reinitialize addresses] /sbin/ifconfig ppp0 inet [...] down Finally, you'll notice the "skill" command being used to check for the existence of a process. You can pick up a copy of "skill" from: ftp://ftp.flux.utah.edu/pub/skill http://freshmeat.net/projects/skill Similarly, the latest version of xnetintf can be retrieved from: ftp://ftp.flux.utah.edu/pub/xnetintf http://freshmeat.net/projects/xnetintf I could add a couple more features to Xnetintf if there is interest: o Locking, so that multiple users could toggle interface state without stepping on each others changes. o Per-interface/per-action hold down period. For example, a VPN may take 2 seconds to connect and 30 seconds to destroy. Ideally, Xnetintf should ignore input and lock the interface state for the duration of these operations (as defined in the configuration file). Please send back any changes, corrections, ports, or feedback! Thanks, Jeff Forys (jeff@forys.cranbury.nj.us) > % md5 xnetintf-1.9.tgz > MD5 (xnetintf-1.9.tgz) = 463123c00545fb17b08659f78ccafb2c > % sum xnetintf-1.9.tgz > 36380 24 xnetintf-1.9.tgz > % cksum xnetintf-1.9.tgz > 4262280732 24007 xnetintf-1.9.tgz