Skip to content

Instantly share code, notes, and snippets.

@raphink
Created December 10, 2012 11:28
Show Gist options
  • Save raphink/4250093 to your computer and use it in GitHub Desktop.
Save raphink/4250093 to your computer and use it in GitHub Desktop.
irb(main):001:0> require 'netcf'
=> true
irb(main):002:0> n = Netcf.new
=> #<Netcf:0x2ab58b74e058>
irb(main):003:0> i = n.lookup_by_name('eth0')
=> #<NetcfIf:0x2ab58b741df8>
irb(main):004:0> puts i.xml_desc
<?xml version="1.0"?>
<interface name="eth0" type="ethernet">
<start mode="onboot"/>
<protocol family="ipv4">
<ip address="10.27.21.127" prefix="24"/>
<route gateway="10.27.21.1"/>
</protocol>
</interface>
=> nil
irb(main):005:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment