AIX 5L Configuring TCP/IP (Unit 05): Static Routing

Unit Objectives
———————–
Describe the concept of routing
Explain the IP routing algorithm
List the types of routes in the route table
Configure static routes

Routing
————
Host A Host C Host B
Application acting as a Application
TCP router/gateway TCP
IP IP Routing IP
Interface W Interface X, Y Interface Z

Network P Network Q

no -0 ipforwarding=1 (no – Network Options)
Note: The default for ipforwarding is set to zero meaning that if there is a packet that is not ment for itself it will simply drop it. If ipforwarding is set to 1 then it will forward the packet on.

Gateways for TCP/IP
——————————–
Attach two or more networks
Provide the routing function at the IP level
Determine the route of a packet by consulting a routing table
Route packets according to the destination network
Have a network interface for each network with which they communicate

Types of Routes
————————
Routing Table Format
dest next stop
——- ————-

Destination can be:
1. Host Route – Specific host IP Address (ex. 192.17.13.2)
2. Network Route – IP Address (ex. 128.17 – smaller routing table)
3. Default Route
Host F’s destinations

Routing Example
————————-
destination deliver via
address gateway
—————- ————–
128.17 128.17.1.1 – Direct Route
192.17.13 192.17.13.1 – Direct Route
128.15 128.17.1.2 – Indirect Route
default 128.17.1.2 – Default Route

IP Routing Algorithm
——————————
Consults routing table
1. Is it for me? Yes – Keep it (Local Host)
2. Is it for any network? Yes – Send using arp table (Direct Attached Network Host
3. Do I have a specific route? Yes – Send to router (Remote Host)
Indirect Routes – Host Route or Network Route
4. Do I have a default route? Yes – Send to Default Gateway
No – No route to host

Example: netstat -rn
——————————–
Examine the routing table
# netstat -rn
Routing tables
Destination Gateway Flags Refs Use If PMTU Exp Groups
Route Tree for Protocol Family 2 (Internet):
default 9.19.98.11 UG 0 0 tr0 – –
9.19.98/24 9.19.98.1 U 3 16567 tr0 – –
127/8 127.0.0.1 U 0 949 lo0
Route Tree for Protocol Family 24 (Internet V6)
……….

Note: The slash “/” refers to the mask (how many bits are in the network part of the ip address.
/24 means 255.255.255.0
/16 means 255.255.0.0
/8 means 255.0.0.0

Establishing Routes
—————————–
Explicit or Static – Manually specify the route
Implicit – The system kernel adds the route to the locally attached network
Dynamic – Other software other than the kernel creates the route
– Routing protocol deamons
– ICMP redirects (better way to send a packet)
– pmtu discovery (protocol that probes the network to find the shortest route)

Static Routing
———————
Manually updated
Practical in small, stable networks
route command
Configured through SMIT
No daemons are involved
/etc/rc.net or SMIT

Configuring Routing through SMIT
————————————————–
# smit mkroute
Add Static Route

Destination Type: net
Destination Address:
Default GATEWAY Address:
METRIC (number of hops to destination gateway):
Network MASK:

route Command
————————
# route add -inet -net 9.19.98.0 9.19.99.11
A: command => add, flush or -f, delete, change, monitor, get
B: family => -inet -xns (optional)
C: flag => -net, -host (network type)
D: destination => symbolic name or numeric address
E: gateway => symbolic name or numeric address

Note: It is good to code these with the actual IP Addresses and not the names just in case name resolution is not working.

route Command Examples
—————————————-
# route add 9.19.98.1 9.19.99.11 (host specific route)
# route add 0 9.19.99.11 (A network of zero(0) means the default route)
# route add -net 9.19.99 9.19.98.11
# route -f (flushes or deletes direct routes, indirect routes are kept create by the kernel based on the interfaces that have been created)
# route delete 0 9.19.99.11 (Must always specify both destination and gateway)
# route add -net default sys11 (default is same as 0, sys11 will be resolved to ip address)

Simple Routing Example
————————————-
See notes

Complex Routing Example
—————————————
See notes

ICMP Redirects
———————–
If one host knows a better way to forward packets it can send an ICMP message back to the sending host letting it know of a better path.
Option to turn it on or off (both to send or process ICMP redirects because of hackers)

ping -R
————-
Shows end-to-end connectivity (displays all addresses through which it was routed)
Shows outbound connections

traceroute
—————
Discovers the various gateways on the path
Shows inbound connections

# traceroute sys10
traceroute to sys10 (201.64.23.10) from sys1e (5.10.10.1)
30 hops max
outgoing mtu=1500

Unit Summary
———————-
Routing is performed by the IP layer of TCP/IP. The IP routing algorithm analyzes direct, indirect, and default routes
Routing tables are built from implicit, explict/static or dynamic entries
IP searches the route table by host routes, network routes, and finally default routes
Static routes are created manually

Exercise 5 – Routing
——————————-
1. Prepare the router
Turn on ip forwarding
no -a | grep ipfor (shows the current setting)
chmod 754 /etc/rc.net
vi /etc/rc.net
go to end of file
/usr/sbin/no -o ipforwarding=1
/usr/sbin/no -o udp_pmtu_discover=0
/usr/sbin/no -o tcp_pmtu_discover=0
save

/etc/rc.net (execute script again)
no -a | grep pmtu (view the settings now)

route -f (flush the routing table)
netstat -r (list the routing table)

2. Prepare the Client
netstat -rn
vi /etc/rc.net
/usr/sbin/no -o udp_pmtu_discover=0
/usr/sbin/no -o tcp_pmtu_discover=0
save

/etc/rc.net (reexecute)
no -a | grep pmtu (verify settings)
route -f (flush routes)
netstat -rn (view the routing table)
route add 9.19.99.4 9.19.98.1 (add a route)
netstat -rn (view changes)
ping 9.19.99.4 (test communication)

Doing the same thing through SMIT adds it to the ODM and will be effective upon reboot.

smitty fshrttbl (flush routing table)
smitty – Communications, TCP/IP, Further Configuration, Static Routes, Flush Routing Table
Add a Static Route
netstat -rn
ping 9.19.99.4 (test route)

ping -c 1 -R ppp3 (-c = count, -R=report)
See remainder of exercise.

Leave a Reply

Your email address will not be published. Required fields are marked *

*