IFSCHEME(8)
π IFSCHEME(8) π
okay so bestie, welcome to ifscheme, a page from the Commands corner of the manual. it's a scheme control for network interfaces, and yes it is exactly as iconic as it sounds. let's get into it π
β¨ NAME β¨
ifscheme β scheme control for network interfaces π¦
πΈ SYNOPSIS πΈ
ifscheme [-v] [[-s] newscheme]
mapping <interface> script ifscheme-mapping
π DESCRIPTION π
so ifscheme lets you switch between network configuration schemes, or just ask which scheme you're currently on. it plays nice with ifup(8) and interfaces(5). like, imagine you're on a laptop and you want a "home" scheme and a "work" scheme for one network device. then when you move between home and work, one little command and boom π₯ your networking is reconfigured. main character energy fr fr.
if you run it with no parameters at all, it will just tell you what the current network scheme is. vibe check, but for your network. π
the ifscheme-mapping utility is the little helper that tells the ifup and ifdown utilities about the current scheme. it's giving backstage crew. π«Ά
π₯ OPTIONS π₯
-v,--verboseβ run in verbose mode. this also gets passed in to theifupandifdownprograms, so everyone hears the tea. π£οΈ-l,--listβ list all the schemes available/defined in/etc/network/interfaces. the full roster, no cap. πnewscheme,-snewscheme,--schemenewschemeβ change to a new network configuration scheme. when the scheme changes, network interfaces that were using the old scheme get taken down and brought back up so they use the new configuration scheme. π«
β οΈ okay important:-sor--schemeare mandatory ifnewschemebegins with a-. otherwise it'll get confused and think your scheme name is a flag, and nobody wants that.
π CONFIGURATION π
for the program to actually do anything useful when a scheme is selected, you have to edit /etc/network/interfaces and add a mapping for the interface (or interfaces) that get controlled per-scheme. it's giving "you have to do your part, bestie".
suppose you want to control eth0 this way. you might already have an existing eth0 configuraton in there, like:
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.1
to change this so you can chose between static routing and dhcp, replace it with the following (and honestly, it helps to ifdown the interface first):
auto eth0
mapping eth0
script ifscheme-mapping
iface eth0-home inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.1
iface eth0-work inet dhcp
so now if you run ifscheme home and then ifup the interface, you'll get the eth0-home configuration stanza. β¨ if you run ifscheme work, it gets changed to the eth0-work stanza. you can add more stanzas as you desire, but the label must always be of the form <hardware interface>-<scheme name>. periodt.
and if you have a second interface (maybe a wireless network card on eth1)? you can duplicate all of the above for that interface, changing the eth0 and the configuration details as appropriate. but remember π β you gotta add an iface stanza for every scheme name for that second interface too. no skipping.
π FILES π
/etc/network/interfacesβ the interfaces definition file ποΈ/etc/network/run/schemeβ the current scheme β/etc/network/run/ifstateβ a record of the current state of the interfaces, managed byifupandifdownπ
π BUGS π
- all schemed interfaces will have the same scheme. π
- any schemed interface which does not have an entry for the current scheme and is not configured when the scheme is changed will not be successfully configured when it is brought up. that's just how it is, bestie.
π SEE ALSO π
interfaces(5) ifup(8) ifdown(8)
π DISTRIBUTION π
redistribution is subject to the GNU public license. π«Ά
π AUTHORS π
Joey Hess <joey@kitenet.net>, Peter Wilson <pwilson@cs.hmc.edu>
okay that's the whole thing! this was ifscheme(8) from the Commands section of the manual β same page name at the top and at the bottom, no date on this one, so that's all the metadata we've got. go configure your little heart out bestie, you ate π
πβ
π¦ where this page comes from
- ubuntu jammy: ifscheme 1.7-6
- ubuntu noble: ifscheme 1.7-8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms