Let check few pre-requirements we need to obtain from the network admin:
- Host name: deby01.dev.local
- Ip address: 192.168.10.21
- Network: 192.168.10/24
- Gateway: 192.168.10.1
- DNS Servers: 192.168.10.2 and 192.168.10.3
- Local Domains: dev.local, corp.local
Here are few simple steps to give your Debian box static IP address:
- Configure hostname:
echo "deby01" > /etc/hostname
- Ensure /etc/hosts file properly resolves localhost:
127.0.0.1 localhost
# In some circumstance it is not recommended to
# resolve machine name to local ip address
#127.0.1.1 deby01.dev.local deby01
- Here is content of /etc/network/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.10.21
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1
- Resolver configuration file /etc/resolv.conf:
domain dev.local
search dev.local dev.local. corp.local.
nameserver 192.168.10.2
nameserver 192.168.10.3
If you need setup a dynamic ip address with DHCP, take a look
here.
No comments :
Post a Comment