Linux 网络连接终端配置

| |
[不指定 2014/01/07 02:21 | by 刘新修 ]

Debian.5.0.6---->7.3/ 网络连接终端配置

修改网络配置文件 : 修改 /etc/network/interfaces

C#代码
    • # The primary network interface
    • auto eth0
    • iface eth0 inet static
    • address 192.168.1.252
    • netmask 255.255.255.0
    • gateway 192.168.1.1

----------k----------

H <---  点 ---> L

----------J---------

VI 删除 配合方向坐位标,如删除右边一个字符是:dL

Debian 重启网络命令: /etc/init.d/networking restart

######################################################################

CentOS-6.5 网络连接终端配置

修改网络配置文件 : 修改 /etc/sysconfig/network-scripts/ifcfg-eth0

 

Python代码
  1. ONBOOT=yes  
  2. BOOTPROTO=static  
  3. IPADDR=192.168.1.10  
  4. NETMASK=255.255.255.0  
  5. GATEWAY=192.168.1.1  
  6. DNS1=192.168.1.1  
  7. BOOTPROTO=dhcp (这里是原来的设置,就是自动获取IP)  

 

========================================

重新导入ifcfg-eth0网络配置文件 
[root@localhost ~]# /etc/init.d/network reload
网卡接口关闭与激活 
[root@localhost ~]# ifdown eth0   #关闭网络
[root@localhost ~]# ifup eth0     #启动网络
网络服务启动与关闭 
方法一:
[root@localhost ~]# service network stop    #关闭网络服务
[root@localhost ~]# service network start   #启动网络服务
[root@localhost ~]# service network restart #重启网络服务
方法二:
[root@localhost ~]# /etc/init.d/network stop
[root@localhost ~]# /etc/init.d/network start
[root@localhost ~]# /etc/init.d/network restart
网卡状态查询 
[root@localhost ~]# service network status
Configured devices:
lo eth0
Currently active devices:
lo eth0

 

Linux/Unix | 评论(0) | 引用(0) | 阅读(4110)