Configuring TCPIP Configuring a network interface In Unix

  • Slides: 8
Download presentation
Configuring TCP/IP

Configuring TCP/IP

Configuring a network interface In Unix there are essentially two commands that are used

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

ifconfig eth 0 Link encap: Ethernet HWaddr 00: 03: FF: 02: 95: 3 E

ifconfig eth 0 Link encap: Ethernet HWaddr 00: 03: FF: 02: 95: 3 E inet addr: 192. 168. 131. 66 Bcast: 192. 168. 131. 255 Mask: 255. 0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU: 1500 Metric: 1 RX packets: 793 errors: 3 dropped: 0 overruns: 0 frame: 0 TX packets: 477 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 1032832 (1008. 6 Kb) TX bytes: 30910 (30. 1 Kb) Interrupt: 11 Base address: 0 xec 00

Creating an Interface ifconfig eth 0 192. 168. 0. 22 netmask 255. 0

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

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

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.

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

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