一、网络设定:
VMware IP地址自动获取:
VM-->Settings->Network Adapter 默认使用NAT(share host's IP)修改成Bridged(connect direct to physical network)
A、以DHCP方式配置网卡
编辑文件/etc/network/interfaces: sudo gedit /etc/network/interfaces
并用下面的行来替换有关eth0的行:
# The primary network interface - use DHCP to find our address auto eth0
iface eth0 inet dhcp
用下面的命令使网络设置生效: sudo /etc/init.d/networking restart
也可以在命令行下直接输入下面的命令来获取地址
sudo dhclient eth0
B、如果修改成为网卡配置静态IP地址
编辑文件/etc/network/interfaces:
sudo vi /etc/network/interfaces
并用下面的行来替换有关eth0的行:# The primary network interface auto eth0
iface eth0 inet static address 192.168.3.90 gateway 192.168.3.1 netmask 255.255.255.0 #network 192.168.3.0 #broadcast 192.168.3.255
将上面的ip地址等信息换成你自己就可以了.用下面的命令使网络设置生效: sudo /etc/init.d/networking restart
要访问DNS 服务器来进行查询,需要设置/etc/resolv.conf文件. nameserver 192.168.10.245 nameserver 192.168.10.247 nameserver 192.168.10.248
二、网络代理设定
Ubuntu 10.04
System(系统) - Preferences(首先项) - Network Proxy(网络代理)工具来配置。
以上设定完成以后:/etc/apt/apt.conf 内容变为:
Acquire::http::proxy \/\Acquire::ftp::proxy \/\Acquire::https::proxy \/\
或者直接修改此文件也可以
此时网络代码将生效
三、apt-get instal 安装软件
源地址记录在文件: /etc/apt/sources.list
首先配置下载源地址:【需求针对不同的ubuntu版本而定,下面给定的为ubuntu10.04版本】
台湾源不错:
deb http://Ubuntu.cn99.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid main universe restricted multiverse
deb http://Ubuntu.cn99.com/ubuntu/ lucid-security universe main multiverse restricted deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-security universe main multiverse restricted deb http://Ubuntu.cn99.com/ubuntu/ lucid-updates universe main multiverse restricted deb http://Ubuntu.cn99.com/ubuntu/ lucid-proposed universe main multiverse restricted deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-proposed universe main multiverse restricted deb http://Ubuntu.cn99.com/ubuntu/ lucid-backports universe main multiverse restricted deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-backports universe main multiverse restricted deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-updates universe main multiverse restricted
更新源,其实也就是更新其上面的头文件,带有可以下载的软件名称及版本等
sudo apt-get update
四、nfs 配置
安装服务端软件:
$sudo apt-get install nfs-kernel-server $sudo apt-get install nfs-common
配置 nfs 路径:
$sudo gedit /etc/exports
\
启动服务:
$sudo /etc/init.d/nfs-kernel-server start
注意点:
Privileges is very important so when running from NFS please make sure that you have the option \
/nfsdir *(rw,no_root_squash,no_all_squash)
利用nfs调试时,一般命令如下:
root=/dev/nfs nfsroot=192.168.44.103:/home/user/nfsdir , bmem=128@128M ip=dhcp rw ,nolock init=/init
在ip前面千万不要加 \号,否则kernel解析命令出错,mount nfs时失败@@@@ 小小的逗号害人哟。
Looking up port of RPC 100005/1 on 192.168.30.54
rpcbind: server 192.168.30.54 not responding, timed out
五、samba 服务配置 (共享群组可读写文件夹)
Samba install:
sudo apt-get install samba samba-common-bin system-config-samba smbfs smbclient
建立用户及密码
系统->管理->用户和组 添加
添加网络使用者的帐号 sudo smbpasswd -a smbuser
sudo gedit /etc/samba/smb.conf
找到下关键字:; security = user 用这几行取代: security = share
将下列几行新增到文件的最后面,假设允许访问的用户为: smbuser 而文件夹的共享名为 ShareFolder [ShareFolder]
comment = Shared Folder with username and password path = /home/smbuser/ public = yes writable = yes
valid users = messcode create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup available = yes browseable = yes
找到[global]把 workgroup = MSHOME 改成 workgroup = WORKGROUP
相关推荐: