LINUX 第五章

|ifconfig

配置网络环境命令

[root@f102 桌面]# ifconfig
eth1      Link encap:Ethernet  HWaddr 10:78:D2:93:C6:ED  
          inet addr:192.168.31.177  Bcast:192.168.31.255  Mask:255.255.255.0
          inet6 addr: fe80::1278:d2ff:fe93:c6ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:259983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156970 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:369104215 (352.0 MiB)  TX bytes:11998939 (11.4 MiB)
          Memory:fbec0000-fbee0000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:454 errors:0 dropped:0 overruns:0 frame:0
          TX packets:454 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:23140 (22.5 KiB)  TX bytes:23140 (22.5 KiB)

virbr0    Link encap:Ethernet  HWaddr C6:2D:65:28:26:4A  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:4220 (4.1 KiB)

|ifconfig

[root@f102 桌面]# ifconfig eth1 192.168.31.111 netmask 255.255.255.0 up ^C
设置一个IP以及子网眼吗,以及激活状态


[root@f102 桌面]# ifconfig eth1
查看是IP地址


[root@f102 桌面]# hostname
f102
显示当前的主机名


[root@f102 桌面]# hostname f111
更改自己的主机名称


设置默认网关路由:

[root@f102 桌面]# route add default gw 192.168.31.1

更改DNS

[root@f102 桌面]# gedit /etc/resolv.conf
更改DNS的文件

格式:

nameserver 8.8.8.8


查看软件是否安装:

[root@f102 桌面]# rpm -qa |grep vsftp
vsftpd-2.2.2-6.el6.i686
查询软件vsftp


制作FTP服务器:

[root@f102 桌面]# rpm -ivh ftp-0.17-51.1.el6.i686.rpm 
warning: ftp-0.17-51.1.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:ftp                    ########################################### [100%]
安装rpm软件包

查看服务运行状态

[root@f102 桌面]# service vsftpd status
vsftpd 已停

重启服务:

[root@f102 桌面]# /etc/init.d/vsftpd restart
关闭 vsftpd:                                              [确定]
为 vsftpd 启动 vsftpd:                                    [确定]

关闭服务:

[root@f102 桌面]# service vsftpd stop
关闭 vsftpd:                                              [确定]

开启服务:

[root@f102 桌面]# service vsftpd start
为 vsftpd 启动 vsftpd:                                    [确定]

设置开机启动的服务

ntsysv 


ftp使用

[root@f111 桌面]# ftp localhost
Connected to localhost (127.0.0.1).
220 (vsFTPd 2.2.2)
Name (localhost:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,159,114).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Jun 05 17:15 123
drwxr-xr-x    2 0        0            4096 May 26  2010 pub
226 Directory send OK.
ftp> get 123
local: 123 remote: 123
227 Entering Passive Mode (127,0,0,1,81,102).
150 Opening BINARY mode data connection for 123 (0 bytes).
226 Transfer complete.
登录本地FTP

使用匿名用户登录

查看所有的文件

下载文件123

下载到了桌面上



bye推出ftp服务器登录状态


更改ftp文件配置

[root@f111 桌面]# gedit /etc/vsftpd/vsftpd.conf










猜你喜欢

转载自blog.csdn.net/zhangkaixu321/article/details/9032091