PC as a Router

yellow

A router must have mac-address table (ip to mac,interface mapping - sometimes call layer 2 forwarding table with an added vlan entries) and forwarding table (net addr to next hope mapping) same is there in a PC too. Output copied below shows the routing table in PC (netstat -r or route print - os as W-XP) and mac table (arp -a). Compare it with the out put of #sh ip route and #sh mac-address table (IOS -CLI) you will see the similarity between both. If you have more than one NIC (multihomed) you can route the traffic to more destinations.

C:\>arp -a

Interface: 105.13.45.91 --- 0x4
Internet Address Physical Address Type
105.13.45.65 00-00-0c-07-ac-00 dynamic

C:\>netstat -r

Route Table
============================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...02 00 4c 4f 4f 50 ...... Microsoft Loopback Adapter
0x3 ...00 13 ce 1b 14 80 ...... Intel(R) PRO/Wireless 2915ABG Network Connection
- Packet Scheduler Miniport
0x4 ...00 12 3f 0c d5 81 ...... Broadcom NetXtreme 57xx Gigabit Controller - Pac
ket Scheduler Miniport
0x5 ...44 45 53 54 42 00 ...... Nortel IPSECSHM Adapter - Packet Scheduler Minip
ort
============================================================
============================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 105.13.45.65 105.13.45.91 20
105.13.45.64 255.255.255.224 105.13.45.91 105.13.45.91 20
105.13.45.91 255.255.255.255 127.0.0.1 127.0.0.1 20
105.255.255.255 255.255.255.255 105.13.45.91 105.13.45.91 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
169.254.0.0 255.255.0.0 169.254.0.1 169.254.0.1 30
169.254.0.1 255.255.255.255 127.0.0.1 127.0.0.1 30
169.254.255.255 255.255.255.255 169.254.0.1 169.254.0.1 30
224.0.0.0 240.0.0.0 105.13.45.91 105.13.45.91 20
224.0.0.0 240.0.0.0 169.254.0.1 169.254.0.1 30
255.255.255.255 255.255.255.255 105.13.45.91 105.13.45.91 1
255.255.255.255 255.255.255.255 169.254.0.1 3 1
255.255.255.255 255.255.255.255 169.254.0.1 169.254.0.1 1
255.255.255.255 255.255.255.255 169.254.0.1 5 1
Default Gateway: 105.13.45.65
===========================================================================
Persistent Routes:
None

C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...02 00 4c 4f 4f 50 ...... Microsoft Loopback Adapter
0x3 ...00 13 ce 1b 14 80 ...... Intel(R) PRO/Wireless 2915ABG Network Connection
- Packet Scheduler Miniport
0x4 ...00 12 3f 0c d5 81 ...... Broadcom NetXtreme 57xx Gigabit Controller - Pac
ket Scheduler Miniport
0x5 ...44 45 53 54 42 00 ...... Nortel IPSECSHM Adapter - Packet Scheduler Minip
ort

============================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 105.13.45.65 105.13.45.91 20
105.13.45.64 255.255.255.224 105.13.45.91 105.13.45.91 20
105.13.45.91 255.255.255.255 127.0.0.1 127.0.0.1 20
105.255.255.255 255.255.255.255 105.13.45.91 105.13.45.91 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
169.254.0.0 255.255.0.0 169.254.0.1 169.254.0.1 30
169.254.0.1 255.255.255.255 127.0.0.1 127.0.0.1 30
169.254.255.255 255.255.255.255 169.254.0.1 169.254.0.1 30
224.0.0.0 240.0.0.0 105.13.45.91 105.13.45.91 20
224.0.0.0 240.0.0.0 169.254.0.1 169.254.0.1 30
255.255.255.255 255.255.255.255 105.13.45.91 105.13.45.91 1
255.255.255.255 255.255.255.255 169.254.0.1 3 1
255.255.255.255 255.255.255.255 169.254.0.1 169.254.0.1 1
255.255.255.255 255.255.255.255 169.254.0.1 5 1
Default Gateway: 105.13.45.65
============================================================
Persistent Routes:
None


adding further with some commands that may help you to add/delete routing entries in W-XP.

Examples:

> route PRINT
> route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
destination^ ^mask ^gateway metric^ ^
Interface^
If IF is not given, it tries to find the best interface for a given
gateway.
> route PRINT
> route PRINT 157* .... Only prints those matching 157*
> route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2

CHANGE is used to modify gateway and/or metric only.
> route PRINT
> route DELETE 157.0.0.0
> route PRINT
0 Responses to "PC as a Router"

Post a Comment