1.临时设置网卡IP:/sbin/ifconfig eth0 网卡IP broadcast broadcast 网卡广播IP netmask 子网掩码 up/sbin/route add default gw 网卡网关例如:/sbin/ifconfig eth0 192.168.1.26 broadcast 192.168.1.255 netmask 255.255.255.0 up/sbin/route add default gw 192.168.1.12.linux配置IP:vi /etc/hosts 再添加一条 网卡IP localhost.localdomain localhostvi /etc/resolv.conf 里面写入:search localdomain nameserver 202.106.0.20 nameserver 202.106.46.151 202.106.195.68vi /etc/sysconfig/network 写入: NETWORKING=yes HOSTNAME=localhost.localdomainvi /etc/sysconfig/network-scripts/ifcfg-eth0 写入:DEVICE=eth0 ONBOOT=yesNATMASK=要设置的子网掩码 IPADDR=要设置的IP地址 GATEWAY=要设置的网关/etc/rc.d/init.d/network restart 重启网络服务,使配置生效。卢韬旭
配置过程: 1.配置静态IP地址 #netconfig-deth0 2.安装vsftpd #rpm-ivhvsftpd-2.0.3-4.i386.rpm 3.修改/etc/vsftpd/vsftpd.conf文件 #vi/etc/vsftpd/vsftpd.conf .... anonymous_enable=NO local_enable=yes write_enable=yes listen=yes listen_address=192.168.1.2 listen_port=21 port_enable=yes pasv_enable=yes pasv_min_port=5000 pasv_max_port=6000 idle_session_timeout=300 data_connection_timeout=120 local_max_rate=2048000 max_clients=150 max_per_ip=4 chroot_local_user=yes userlist_enable=yes userlist_deny=yes userlist_file=/etc/vsftpd/deny_users tcp_wrappers=yes user_config_dir=/etc/vsftpd/conf ..... 4.创建相关文件及目录 #touch/etc/vsftpd/deny_users #mkdir/etc/vsftpd/conf 5.启动vsftpd服务 #ntsysv--level345 #servicevsftpdrestart