Configuring a network interface In Unix there are essentially two commands that are used to enable TCP/IP. Ifconfig – (Interface Configuration) Route -Adds a network route
Creating an Interface ifconfig eth 0 192. 168. 0. 22 netmask 255. 0
Running DHCP To obtain an IP address from a DHCP server one would use dhcpcd(Client Daemon) dhcpcd eth. X Where X is the network interface number.
Specifying a DNS Server /etc/resolv. conf This file would contain the following; Nameserver <IP OF DNS SERVER>
Adding a route The following are sample route commands. route add –net 192. 168. 5. 0 netmask 255. 0 eth 0 Adds a route to the 192. 168. 5. 0/24 network (no gateway)
Route example (Con’t) Route add –net 192. 168. 22. 0 netmask 255. 0 gw 192. 168. 22. 5 eth 0 Adds a route to the 192. 168. 22. 0/24 network with 192. 168. 22. 5 as a gateway. Route add default gw 192. 168. 0. 1 Sets 192. 168. 0. 1 as the default gateway