设置主机名
echo "xhr4412" > /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "127.0.0.1 xhr4412" >> /etc/hosts
网卡配置
sudo vim /etc/network/interfaces
static IP:
auto eth0
iface eth0 inet static
address 192.168.177.132
netmask 255.255.255.0
gateway 192.168.177.2在这里插入代码片
dynamic IP:
auto eth0
iface eth0 inet dhcp
restart network:
/etc/init.d/networking restart
config by hand:
sudo ifconfig eth0 192.168.177.132
sudo route add default gw 192.168.177.2
- 设置 dns:
vim /etc/resolv.conf
nameserver 192.168.177.2
vim 永久显示行号
vim /etc/vim/vimrc
set nu
set autoindent
set ts=4
参考