Linux下路由相关设置
分类:LINUX杂记日期:2011-04-13作者:雨尚
Linux下路由相关设置
增加网关
route add default gateway 192.168.252.174
删除网关
route del default gateway 192.168.252.174
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.135 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
192.168.1.135 10.0.0.1 255.255.255.255 UGH 0 0 0 eth2
192.168.1.111 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
192.168.1.111 10.0.0.1 255.255.255.255 UGH 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth2
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
举例, 添加一条路由(发往192.168.62这个网段的全部要经过网关192.168.1.1)
route add -net 192.168.252.0 netmask 255.255.255.0 gw 192.168.252.174
删除一条路由
route del -net 192.168.252.0 netmask 255.255.255.0
删除的时候不用写网关
转载请注明来自:LinuxSEE

I’m impressed! You’ve mnagaed the almost impossible.
Fell out of bed feeling down. This has birgtheend my day!
Surpeior thinking demonstrated above. Thanks!
Extremely hlefpul article, please write more.
Umm, are you really just gviing this info out for nothing?
What a joy to find such clear thinking. Thanks for pstoing!
One or two to rmeemebr, that is.
More posts of this quality. Not the usual c***, peslae
This site is like a classroom, ecxept I don’t hate it. lol
Dag nbbait good stuff you whippersnappers!
Times are chaingng for the better if I can get this online!
TYVM you’ve sovled all my problems
IJWTS wow! Why can’t I think of tinhgs like that?
What a great resuroce this text is.
Hello there! I know this is somewhat off topic but I was wondering which blog platform are you using for this site? I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.
I always use this platform
Hey. I clearly would like to actually make a nice quick comment and also let you understand that in fact I’ve been following your internet page for quite some time. Keep up the very wonderful task and I am going to be browsing again again in the near future.
thanks a lot