Adding a default route in Linux. How to define the default gateway.

Posted: October 7, 2015. At: 11:37 AM. This was 2 years ago. Post ID: 8421
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

Adding a default route in Linux is easy. The route command is the best way to do this.

~# route add default gw 172.18.31.1

I used this command on a machine that previously had an IP address in the 192.168.0.xx range and the default gateway was 192.168.0.1. So I had to change it and this command was the best way.

No comments have been made. Use this form to start the conversation :)

Leave a Reply