HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Adding two new nics and creaing the default ga...
Operating System - Linux
1827756
Members
2932
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2008 12:42 AM
04-10-2008 12:42 AM
Adding two new nics and creaing the default gateway for each
I am using Redhat linux As4
I already have Bond0 created with a defualy gateway, but I haave added two ned nics, eth2 and eth3.
This is the setup
Eth2 ip address 10.134.30.42 subnet 255.255.255.128 default gateway 10.134.30.1
Eth2 ip address 10.134.30.170 submet mask 255.255.255.128 default gateway 10.134.30.129
I would like to define a default gateway for each Nic.
So all traffic going out from eth2 routes via 10.134.30.1 and all traffic going from eth3 routes via 10.134.30.129
I already have Bond0 created with a defualy gateway, but I haave added two ned nics, eth2 and eth3.
This is the setup
Eth2 ip address 10.134.30.42 subnet 255.255.255.128 default gateway 10.134.30.1
Eth2 ip address 10.134.30.170 submet mask 255.255.255.128 default gateway 10.134.30.129
I would like to define a default gateway for each Nic.
So all traffic going out from eth2 routes via 10.134.30.1 and all traffic going from eth3 routes via 10.134.30.129
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2008 01:08 AM
04-10-2008 01:08 AM
Re: Adding two new nics and creaing the default gateway for each
set iptables roules.
a warrior never quits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2008 06:07 AM
04-14-2008 06:07 AM
Re: Adding two new nics and creaing the default gateway for each
And when an outgoing packet has a destination of, say, 123.45.67.89, which NIC or bond should it use then? Is there only one good option, or might there be another gateway that is not as good but might be used if the primary gateway does not work?
Remember that there are no such things as "connections" or "sessions" on the IP level: by default, each packet is routed using its own address information and nothing else.
The "default gateway" is what is used if the routing table has no more specific instructions for a particular destination address.
You have listed two new gateways, in addition to the old default gateway. Is the entire IP address space of the whole Internet truly reachable through all these three gateways?
If yes, the destination IP address alone is insufficient for determining the correct outgoing network interface. This is where the traditional routing table and the "route" command become inadequate: you must use the advanced techniques of "policy routing", and the command for configuring it is "ip".
See:
http://www.policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html
If no, then some of these gateways are not really "default" gateways, but just "limited" gateways to some definable sub-sets of IP addresses. This can be handled using a traditional routing table: when setting up the route manually, instead of "route add default gw", you specify one or more commands like "route add -net netmask gw ". To make these settings permanent, you should create files like /etc/sysconfig/network-scripts/route-.
For example, if your eth2 has connectivity to 10.134.20.0/255.255.255.0 and 10.134.21.0/255.255.255.0 and eth3 to 10.133.0.0/255.255.0.0, you could write two files:
/etc/sysconfig/network-scripts/route-eth2:
ADDRESS0="10.134.20.0"
NETMASK0="255.255.255.0"
GATEWAY0="10.134.30.1"
ADDRESS1="10.134.21.0"
NETMASK1="255.255.255.0"
GATEWAY1="10.134.30.1"
/etc/sysconfig/network-scripts/route-eth3:
ADDRESS0="10.133.0.0"
NETMASK0="255.255.0.0"
GATEWAY0="10.134.30.129"
MK
Remember that there are no such things as "connections" or "sessions" on the IP level: by default, each packet is routed using its own address information and nothing else.
The "default gateway" is what is used if the routing table has no more specific instructions for a particular destination address.
You have listed two new gateways, in addition to the old default gateway. Is the entire IP address space of the whole Internet truly reachable through all these three gateways?
If yes, the destination IP address alone is insufficient for determining the correct outgoing network interface. This is where the traditional routing table and the "route" command become inadequate: you must use the advanced techniques of "policy routing", and the command for configuring it is "ip".
See:
http://www.policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html
If no, then some of these gateways are not really "default" gateways, but just "limited" gateways to some definable sub-sets of IP addresses. This can be handled using a traditional routing table: when setting up the route manually, instead of "route add default gw
For example, if your eth2 has connectivity to 10.134.20.0/255.255.255.0 and 10.134.21.0/255.255.255.0 and eth3 to 10.133.0.0/255.255.0.0, you could write two files:
/etc/sysconfig/network-scripts/route-eth2:
ADDRESS0="10.134.20.0"
NETMASK0="255.255.255.0"
GATEWAY0="10.134.30.1"
ADDRESS1="10.134.21.0"
NETMASK1="255.255.255.0"
GATEWAY1="10.134.30.1"
/etc/sysconfig/network-scripts/route-eth3:
ADDRESS0="10.133.0.0"
NETMASK0="255.255.0.0"
GATEWAY0="10.134.30.129"
MK
MK
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP