Ask a question about the network configuration,
The network connection graphical interface has 2 configurations, where system eth0 has the corresponding profile/etc/sysconfig/network-scripts/ifcfg-eth0, but ZHOUCF this configuration is I manually added in the graphical interface, Where is the corresponding configuration file for it? I want to initialize Linux has a pure network configuration, with the command line to delete the above image of the ZHOUCF configuration what to do? -----------------------------
find/root-type f-name "*" | xargs grep "ZHOUCF"
Find/root/.gconf/system/networking/connections/2/connection/%gconf.xml: <stringvalue>zhoucf22</ Stringvalue>/root/.gconf/system/networking/connections/1/connection/%gconf.xml: <STRINGVALUE>ZHOUCF </stringvalue>
The numbers 1 and 2 in the path represent the 1th and 2nd manually configured network settings, and the entry folder 1,ll display reads as follows: [[email protected]desktop]# CD/ROOT/.GCONF/SYSTEM/NETWORKING/CONNECTIONS/1
[[email protected]1]# LL
Total 16
DRWX------. 2 root root 4096 Sep 7 17:11 802-3-ethernet
DRWX------. 2 root root 4096 Sep 7 17:11 Connection
-RW-------. 1 root root 0 Sep 7 16:48%gconf.xml
DRWX------. 2 root root 4096 Sep 7 17:11 IPv4
DRWX------. 2 root root 4096 Sep 7 17:11 IPv6 which
The Link's name ID, uuid, type, and so on are configured in Connection/%gconf.xml, with the following content:XML code
- <? XML version="1.0"?>
- <gconf>
- <entry name="timestamp" mtime="1410081115" type="string">
- <stringvalue>1410081115</stringvalue>
- </Entry>
- <entry name="type" mtime="1410081115" type="string">
- <stringvalue>802-3-ethernet</stringvalue>
- </Entry>
- <entry name="uuid" mtime="1410081115" type="string">
- <stringvalue>c0a50c06-f281-48ca-b1d5-6499ffb98b48</stringvalue>
- </Entry>
- <entry name="id" mtime="1410081115" type="string">
- <stringvalue>ZHOUCF</stringvalue>
- </Entry>
- <entry name="name" mtime="1410081115" type="string">
- <stringvalue>connection</stringvalue>
- </Entry>
- </gconf>
ipv4/
The IP address, DNS, and so on are configured in/%gconf.xml, where the address is represented numerically in reverse IPXML code
- <? XML version="1.0"?>
- <gconf>
- <entry name="routes" mtime="1410081115" type="list" ltype="int" >
- </Entry>
- <entry name="address-labels" mtime="1410081115" type= "list" ltype=" String ">
- <li type="string">
- <stringvalue></stringvalue>
- </li>
- </Entry>
- <entry name="addresses" mtime="1410081115" type= "list" ltype="int ">
- <li type="int" value=" -939415360"/>
- <li type="int" value="/> "
- <li type="int" value="16885952"/>
- </Entry>
- <entry name="DNS" mtime="1410081115" type="list" ltype="int" >
- <li type="int" value="16885952"/>
- </Entry>
- <entry name="method" mtime="1410081115" type="string">
- <stringvalue>manual</stringvalue>
- </Entry>
- <entry name="name" mtime="1410081115" type="string">
- <stringvalue>ipv4</stringvalue>
- </Entry>
- </gconf>
Java COMPUTE Code:Java code
- Public class Iplong {
- /**
- * The IP address turns into an integer.
- * @param IP
- * @return
- */
- public static long ip2long (String IP) {
- string[] ips = Ip.split ("[.]");
- Long num = 16777216l*long.parselong (ips[0]) + 65536l*long.parselong (ips[1]) + 256*long.parselong (ips[ 2]) + Long.parselong (ips[3]);
- return num;
- }
- /**
- * integers are converted to IP addresses.
- * @param iplong
- * @return
- */
- public static String Long2ip (long Iplong) {
- //long iplong = 1037591503;
- long mask[] = {0x000000ff,0x0000FF00,0x00ff0000,0xff000000};
- Long num = 0;
- StringBuffer ipinfo = new StringBuffer ();
- For (int i=0;i<4;i++) {
- num = (Iplong & Mask[i]) >> (i*8);
- if (i>0) Ipinfo.insert (0,".");
- Ipinfo.insert (0,long.tostring (num,10));
- }
- return ipinfo.tostring ();
- }
- public static void Main (string[] args) {
- //system.out.println (Ip2long ("219.239.110.138"));
- System.out.println (Ip2long ("192.168.1.200")); 3232235976
- System.out.println (Ip2long ("200.1.168.192")); 3355551936
- System.out.println (Long2ip (16885952)); 16885952 configuration of DNS in Ipv4//%gconf.xml
- ///Printed results: -56.1.168.192
- System.out.println (Long2ip (-939415360)); 939415360 configuration of addresses in Ipv4//%gconf.xml
- //Print result -56.1.168.192 (where 256-56=200) is calculated by 200.1.168.192
- }
- }
Summary:
1, configuration Linuxip time, set ifcfg-eh0 on the line, this is the system level, in the graphical interface manually configured IP settings, is user-level, and reboot, the system will first load the system-level configuration
2, in the analysis process to find the command is not:
grep "ZHOUCF"-rl/root
and the
find/root-type f-name "*" | xargs grep "ZHOUCF"
3, Know NetworkManager is how to store IP configuration, you can be assured that the configuration of Ifcfg-ech0 to configure the network settings
centos6.5 graphical interface networkmanager configuring IP file location