步骤
- 配置IP
tee /etc/network/interfaces <<-'EOF'
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.11
gateway 192.168.1.1
netmask 255.255.255.0
EOF
- 配置DNS
tee /etc/resolvconf/resolv.conf.d/base <<-'EOF'
nameserver 192.168.1.1
EOF
- 配置hostname(如果需要)
tee /etc/hostname <<-'EOF'
rain-host
EOF
- 重启网络
service network restart