Here is my server OS:
root@myserver# showrev
Hostname: myserver
Hostid: 84623972
Release: 5.10
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.10 Generic_118833-23
root@myserver #
1. Display the current routing table:
root@myserver# netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
10.6.40.0 10.6.40.40 U 1 2747 bge0
10.6.40.0 10.6.40.60 UG 1 0
192.168.199.0 10.6.40.60 UG 1 4783
192.168.199.0 10.6.40.60 UG 1 0
default 192.168.4.254 UG 1 128435
127.0.0.1 127.0.0.1 UH 7 4277 lo0
root@myserver #
2. Add the new route entry into the routing table:
root@myserver # route add -net 172.27.97.0 -netmask 255.255.255.0 10.6.40.60
add net 172.27.97.0: gateway 10.6.40.60
root@myserver #
3. Print the new routing table again to comfirm entry:
root@myserver# netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
10.6.40.0 10.6.40.40 U 1 2747 bge0
10.6.40.0 10.6.40.60 UG 1 0
192.168.199.0 10.6.40.60 UG 1 4783
192.168.199.0 10.6.40.60 UG 1 0
172.27.97.0 10.6.40.60 UG 1 1
default 192.168.4.254 UG 1 128435
127.0.0.1 127.0.0.1 UH 7 4277 lo0
root@myserver #
4. And if you need to delete the route entry:
root@myserver #route delete -net 172.27.97.0 -netmask 255.255.255.0 10.6.40.60
delete net 172.27.97.0: gateway 10.6.40.61
5. Print the routing table again to confirm that it has been deleted:
root@myserver# netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
10.6.40.0 10.6.40.40 U 1 2747 bge0
10.6.40.0 10.6.40.60 UG 1 0
192.168.199.0 10.6.40.60 UG 1 4783
192.168.199.0 10.6.40.60 UG 1 0
default 192.168.4.254 UG 1 128435
127.0.0.1 127.0.0.1 UH 7 4277 lo0
root@myserver #
No comments:
Post a Comment