Default gateways on UNIX/Linux

“UNIX is UNIX isn’t it?”  How many times have I heard that said?  Well, no it isn’t actually, as most vendors have their own ways of configuring things like networking on their now highly evolved individual flavours of UNIX.  Even Linux differs between distro.

Here’s a quick reference to where the  default gateway is set.  Don’t forget to restart networking.  For more advanced routing, configure static routes (link at bottom of post).

AIX

smitty mktcpip

HPUX

set_parms addl_network

Solaris

Edit the /etc/defaultrouter file

Red Hat Linux

Edit the /etc/sysconfig/network file

Add line GATEWAY=192.168.0.1

Debian/Ubuntu

Edit the /etc/network/interfaces file

Add line gateway 192.168.0.1

Restart Networking

You’ll need to restart networking to make these changes take effect.  This can generally be achieved with the

AIX: Performed within smitty mktcpip

HPUX: /etc/init.d/net restart

Solaris: svcadm restart physical

RedHat: /etc/init.d/network restart or service network restart

Debian/Ubuntu: /etc/init.d/networking restart

Configuring Static Routes in multi-homed systems.

For more advanced networking with systems containing multiple NICs connecting to multiple VLANs and subnetworks, you’ll need to configure static routes to effectively send the data destined for a machine in such-and-such a network out through the correct NIC.  More can be found on this here…

Adding a persistent static route

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.