Network settings

Je kent het wel: "dju, waar moest ik dat nu weer aanpassen?’ of “Waar fixeerde ik dat ip-adres?”…
You’ll recognize it: ""hmmm, what was that f****ng file to change my local dns? Or we could I fix that IP-address again?

Enkele netwerkinstellingen

IP-addres

/etc/sysconfig/network-scripts/ifcfg-eth0
of
/etc/network/interfaces

See with: ifconfig

Gateway:

/etc/sysconfig/network-scripts/ifcfg-eth0
of
/etc/network/interfaces

See with: netstat -nr

Subnet:

/etc/sysconfig/network-scripts/ifcfg-eth0
of
/etc/network/interfaces

Controleert je routeringen: route -n

DNS:

/etc/resolv.conf

In here, you can also specify the search domain
DNS local:
/etc/hosts

Hostname:
/etc/sysconfig/network

See with: hostname

NTP:

/etc/ntp.conf

Aanpassen vast IP-adres

vi /etc/network/interfaces
of
vi /etc/sysconfig/network-scripts/ifcfg-eth0
auto eth0
iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
gateway 192.168.1.1

auto eth1
iface eth1 inet dhcp

Some out of the box things
Add second IP on card

ifconfig eth0:0 111.222.333.444
ifconfig eth0:1 111.222.333.445

Remove second IP on card

ifconfig eth0:0 del 111.222.333.444