NetworkManager plug-in with writing support preview

Hi guys, I’ve almost implemented witting support now and I’m sure you could use it very soon. Hope you will like it.

Here is a sample configuration which the plug-in automatically generated (yes, this is the writing support I’m talking about). The format is not decided yet and welcome your advice.

Since I used HashTable to store options, the order of options is difficult to control. Currently I just make sure the options belong to the same connection will stay together. If you think better order is very important, I will try to arrange them before writing to configuration file. But I have to say that’s time-consuming and the code will be hard to read if you want to make the order perfect. We also could consider lexicographical order which could at least give a fixed position for every option.

Anyway, I guess out of order is not that bad 😛

  • /etc/conf.d/net :
#Generated by NetworkManager
###### Global Configuration ######
metric="5"

###### Connection Configuration ######
#----------------------------------
dns_servers_eth1="202.116.0.20 202.117.0.21 4321:0:1:2:3:4:567:89ab"
routes_eth1=(
     "default via 192.168.4.1"
     "192.168.4.0/24 via 192.168.4.1"
     "4321:0:1:2:3:4:567:89ab/64 via 4321:0:1:2:3:4:567:89ab"
)
dns_search_eth1="abc.com cde.com"
enable_ipv6_eth1="true"
config_eth1=(
     "192.168.4.122/24"
     "4321:0:1:2:3:4:567:89ab/64"
     "4321:0:1:2:3:4:567:89ac/64"
)
auto_eth1="true"
#----------------------------------
key_qiaomuf="[1] xxxx-xxxx-xx key [1] enc open"
enable_ipv6_qiaomuf="false"
config_qiaomuf=( "dhcp" )
auto_qiaomuf="false"
#----------------------------------
username_ppp0="xxxxxx"
auto_ppp0="false"
password_ppp0="xxxxxx"

  • /etc/wpa_supplicant/wpa_supplicant.conf :
#Generated by NetworkManager
###### Global Configuration ######
ctrl_interface_group=wheel
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1

###### Security Configuration ######
network={
    private_key_passwd="whatever"
    ca_cert="/home/gentoo/temp/ca.pem"
    ssid="myxjtu2"
    mode=0
    priority=1
    identity="qiaomu"
    key_mgmt=WPA-EAP
    eap=TLS
    private_key="/home/gentoo/temp/client.p12"
}

network={
    priority=1
    key_mgmt=WPA-PSK
    mode=0
    psk="whatever"
    ssid="qiaomuf"
}
Advertisements

,

  1. #1 by James Le Cuirot on May 23, 2010 - 1:43 am

    I didn’t know you were going to make NM work with Gentoo’s regular scripts. I am suddenly a little more interested. Great work!

    • #2 by qiaomuf on May 23, 2010 - 5:04 am

      Thanks. Welcome to join and test 🙂

  2. #3 by Alexander E. Patrakov on May 23, 2010 - 2:07 am

    Why does the task “make NM work with Gentoo’s regular scripts” even exist? How is it going to be better than disabling the OpenRC network support and using the generic GKeyFile NM backend?

    • #4 by qiaomuf on May 23, 2010 - 5:08 am

      Most users are using current configuration files and they don’t want to change. Meanwhile, few Gentoo users would like to using NetworkManager including me because it’s not compatible with Gentoo’s configuration file. It would be very useful and attractive when NM could deal with /etc/conf.d/net and other files. Redhat, Suse and Ubuntu has already done that.

  3. #5 by Milan on May 23, 2010 - 2:46 am

    Hi, I never used networkmanager but now it sounds interesting. What will happen with stuff that nm can’t do, for example is bridging supported? Will net init scripts be started together with nm and will plugin just ignore stuff that it can’t handle but it will continue to work? Here is what I have now for example on one machine, can I use something like together with networkmanager?

    modules=( “iproute2” )
    config_eth0=( “null” )
    config_eth1=( “dhcp” )
    config_kvm0=( “null” )
    config_kvm1=( “null” )

    tuntap_kvm0=”tap”
    tuntap_kvm1=”tap”
    tunctl_kvm0=”-u user”
    tunctl_kvm1=”-u user”

    depend_br0()
    {
    need net.eth0
    need net.kvm0
    need net.kvm1
    }

    bridge_br0=”eth0 kvm0 kvm1″
    config_br0=( “192.168.1.10/24” )
    brctl_br0=( “setfd 0″)
    dhcp_eth1=”nosendhost nontp -I”

    • #6 by qiaomuf on May 23, 2010 - 5:14 am

      The ultimate goal of this project is replacing net.* by NM. Init scripts will be modified when the project goes into portage. It will ignore stuff that it can’t handle.
      Take your configuration file for example, it will ignore kvm* and br* but still deal with eth1. Ignored stuff will still be reserved for writing.

  4. #7 by Markos Chandras on May 23, 2010 - 10:38 am

    Excellent work my friend

    Hope to see your project in complete state really soon 🙂

    • #8 by qiaomuf on May 23, 2010 - 6:40 pm

      Thank you :). I hope to release the writing support in this week. It won’t be long when the project goes into a complete state.

  5. #9 by Rob on May 27, 2010 - 12:52 am

    I’ve pushed version with writing support to my overlay (layman -a dagger) as 0.8-r101. Enjoy!

    PS. Great work mate!

    • #10 by qiaomuf on May 27, 2010 - 8:43 pm

      Thank you Rob. You are really kind. I can’t make it without your help :).

  6. #11 by Steve` on May 29, 2010 - 9:30 pm

    Hi,
    thanks for all your work on NetworkManager. It would be great to have a working NetworkManager in Gentoo and it also would be great to have a working KDE4-nm-plasma-applet. 🙂

    Still fiddling around with the gnome-one here 🙂

    many thanks for all your good work.

    • #12 by qiaomuf on May 29, 2010 - 9:46 pm

      Thank you for your compliment :). Really looking forward to your feedback

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: