Ubuntu Linux Configure Gateway / Default Routing IP Address
Q. How do I configure default router or gateway IP address under Ubuntu Linux / Debian Linux? How do I change default router / gateway IP under Ubuntu Linux?
A. You can easily configure default router or gateway IP address under Debian / Ubuntu Linux by editing /etc/network/interfaces network configuration file. This file defines how you configure and how your system is connected to the network.
Ubuntu Linux Configure Default Gateway
Open /etc/network/interfaces file:
$ sudo vi /etc/network/interfaces
Set gateway using following syntax:
gateway {router-ip}
For example, set gateway to 192.168.1.254, enter:
gateway 192.168.1.254
At the end it should look like as follows:
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
Save and close the file. Restart networking:
$ sudo /etc/init.d/networking restart
Verify new routing is working, enter:
$ ping 192.168.1.254
$ route -n
$ host google.com
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Red Hat / CentOS Linux Setting a Default Gateway
- How do I find out my Linux gateway / router IP address?
- Debian / Ubuntu Linux Setting a Default Gateway
- How to bind a range of IP’s in Debian / Ubuntu Linux
- Openbsd change, add or display default gateway
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: /etc/network/interfaces, 192 168 1 1, 192 168 1 254, 192 168 1 254 route, default gateway, default router, gateway default, gateway ip address, gateway router, Linux, linux debian, linux network, network configuration, network interfaces, Networking, static address, syntax




Recent Comments
Today ~ 5 Comments
Today ~ 1 Comment
Yesterday ~ 1 Comment
Yesterday ~ 2 Comments
Yesterday ~ 10 Comments