Setting a Default Gateway for Redhat / CentOS systems?
There are two possible ways for adding a default gateway.
Option 1: You can add a gateway definition to the /etc/sysconfig/network file. This definition will apply to all network interfaces.
Let’s say that your gateway is 192.168.4.1, then you need to add the following line to /etc/sysconfig/network file.
GATEWAY=192.168.4.1
Option 2: You can define a default gateway for a specific interface. For this approach you need to modify your nterface definition. Let’s say we want to modify eth0 then you need to add the same definition to the /etc/sysconfig/network-scripts/ifcfg-eth0 file.
For both options, your modifications will be activated after you restart your networking service.
root@centos ~]# /etc/init.d/networking restart
Related posts:
- Keeping the old kernel as default after a kernel upgrade
- KVM And Bridge Network Definition On Ubuntu
- Ubuntu KVM Virtualization Host: Networking
- Disabling SELinux on CentOS
- Configuring an additional Yum repository.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
