Changelog:
12.12.2005 - Started coding, alpha ready
13.12.2005 - Fixed bug in addconfig()
- added showconfig() to the menu
- added [k]ill dhcpcd to the menu
- rewritten randmac, now you can use a prefix for randmac -> randmac 00:00:86
- added RANDOM / randip -> random ips possible, you can also use a prefix -> randip 192.168.0
- changed parseconfig() and addconfig() to work with randmac/randip
15.12.2005 - added rotate command line switch, useful if you're pentesting ;)
18.12.2005 - confirmed that WLAN mode works fine :)
27.12.2005 - fixed typo with wlan
- fixed severe error with using macs
03.01.2006 - created killdhcpcd()
- CONFDIR will now be created if it does not exist and you try adding an entry
- Released under the GPL-v2
23.01.2006 - removed exit() when iwconfig isn't found: maybe someone just wants to configure a LAN
31.01.2006 - wrote an ebuild for Gentoo linux
TODO:
- exclude mode for RANDOM
- check if RANDOM ip/mac is already there
- use ip & netmask for calculation of random ip
- add WPA(2) support
Known bugs:
- When creating config files via hand you can get into trouble. Just use the menu dialog to create configs.
You should use the menu, especially for creating configs!
Just run ifswitch without any comand line switches:
ifswitch - network interface config switcher v0.9.2
[u]se existing config
[s]how configs
[a]dd network configuration
[d]elete an existing config
[t]est internet connectivity
[k]ill running dhcpcd
[r]estart pcmcia services
[e]nd
>
Some command line modes are also available:
# ./ifswitch --help
ifswitch - network interface config switcher v0.9.2
usage: ifswitch [Config-NR] [rotate] [time to wait between rotate]
[-show]
Command line mode is mostly only used for rotate-mode
Call ifswitch without arguments to use the menu
# ./ifswitch -show
[1]: "School, WLAN, static ARP, random MAC"
[2]: "Standart DHCP network"
[3]: "22C3 Cable LAN, DHCP, static ARP, random MAC"
# ./ifswitch 1
Setting mac de:ad:be:ef:ca:fe on interface eth0: OK
Using essid WLAN with key 12345 on interface eth0: OK
Setting ip 172.16.85.123 on interface eth0: OK
Setting netmask 255.255.0.0 on interface eth0: OK
Setting dns server 192.168.0.2: OK
Setting default gateway 172.16.1.200: OK
Adding static arp entry 192.168.0.2/00:11:22:33:44:55 : OK
# ./ifswitch 3 rotate 60
Setting random mac 00:21:12:32:cf:fa on interface eth0: OK
Using DHCP auto configuration: OK
Adding static arp entry 192.168.0.2/00:11:22:33:44:55 : OK
Setting random mac 00:18:31:4b:ca:01 on interface eth0: OK
Using DHCP auto configuration: OK
Adding static arp entry 192.168.0.2/00:11:22:33:44:55 : OK
... this will re-run the ifswitch configuration nr 3 every 60 seconds
This is useful if you want to stay anonymous on a LAN ;)
Written by Stefan Behte
Contact me, if you have any new ideas, bugs/bugfixes, recommondations or questions!
Please also contact me, if you just like the tool. :)
Stefan dot Behte at gmx dot net
Released under the GPL-v2