Oracle Linux Add route delete route default gateway

Hi,

You can Change default gateway and routing settings like below.

You can add default gateway to the linux like below.

route add default gw 192.168.163.1

 

If you want to delete default gateway you can execute like following script.

route delete default gw 192.168.163.1 eth1

 

You can add routing and gateway settings like below.

route add -net 192.168.63.0/24 gw 192.168.163.1

Or if you want to do permanent routing, you can create route file like below.

[root@deveci02 ~]#
[root@deveci01 network-scripts]# cat route-eth1
192.168.63.0/24 via 192.168.163.1 dev eth1
192.168.161.0/24 via 192.168.161.1 dev eth0

 

If you create routing file like above then you can restart network service like below.

[root@deveci01 network-scripts]# service network restart

 

then Routing will be like below.

[root@deveci01 network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.161.1 0.0.0.0 UG 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 ibbond0
192.168.161.0 * 255.255.255.0 U 0 0 0 eth0
192.168.16.0 * 255.255.255.0 U 0 0 0 ibbond0
192.168.18.0 * 255.255.255.0 U 0 0 0 veth1
192.168.19.0 192.168.18.1 255.255.255.0 UG 0 0 0 veth1
192.168.63.0 192.168.163.1 255.255.255.0 UG 0 0 0 eth1
192.168.163.0 * 255.255.255.0 U 0 0 0 eth1

Mehmet Salih Deveci

I am Founder of IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience. I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource. I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks. I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients. If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com. -                                                                                                                                                                                                                                                 - Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.