STORY of AODDY. » Post 'Linux setup default gateway with route command'

Linux setup default gateway with route command

วันนี้มีปัญหาว่าไอ้เครื่อง Server ที่ผมดูอยู่มัน ping ไปบาง network ที่ต้องการไม่ได้ ผมจึงลองใช้ command route ดูปรากฏว่ามัน ชี้ default gateway ไปอีก ip ก็เลยต้องทำการ change default gateway ให้มันใหม่ โดยใช้ command ดังนี้

# route add default gw 172.16.1.1 eth0

แล้วก็ลอง พิมพ์ route command ดูอีกทีมันก็จะเปลี่ยนให้ครับ… จบ

ขอเพิ่มอีกนิดครับ… มีอีกคำสั่งในการเพิ่ม route ให้กับ network ครับ ดังนี้

# ip route add 172.16.2.0/24 via 172.16.1.1

ตรง 172.16.1.1 ก็เป็น Gateway ที่เราอยากให้ IP กลุ่ม 172.16.2.0/24 วิ่งผ่าน

จบแต้ๆ..เจ้า

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Leave a comment

XHTML - You can use:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2008 STORY of AODDY. is powered by WordPress