- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: linux dual nic interfaces configuration
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
03-19-2007 08:47 AM
03-19-2007 08:47 AM
One is production and one is for testing, or
future backup network.
How do I specify a network route for this
second testing interface. There are way too
many network config files to work with here.
Basically I have for working info:
ncc9t 10.40.191.51 255.255.255.224
ncc9 10.40.167.17 255.255.252.0
Default route 10.40.164.1
Need alternate route for network 10.40.191. ??
/etc/hosts
127.0.0.1 localhost.localdomain localhost
10.40.167.17 ncc9
10.40.191.51 ncc9t
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.40.191.32 0.0.0.0 255.255.255.224 U 0 0 0 eth1
10.40.164.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 10.40.164.1 0.0.0.0 UG 0 0 0 eth0
/etc/sysconfig/network-scripts/ifcfg-eth1
# Intel Corporation 82545GM Gigabit Ethernet Controller
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.40.191.51
NETMASK=255.255.255.224
HWADDR=00:15:17:0B:01:4D
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=10.40.167.255
IPADDR=10.40.167.17
NETMASK=255.255.252.0
NETWORK=10.40.164.0
ONBOOT=yes
TYPE=Ethernet
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ncc9
GATEWAY=10.40.164.1
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 09:27 AM
03-19-2007 09:27 AM
SolutionNo matter how many NIC cards you have you can only have one default route.
That will be the systems first choice concerning routing traffic.
After that it will use the gateway assigned to that NIC.
I do not see a compelling reason to change configuration. If there is a problem, you need to state it more clearly.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 09:33 AM
03-19-2007 09:33 AM
Re: linux dual nic interfaces configuration
/etc/sysconfig/network-scripts/route-ethX
For example:
Assume your eth0 device has the address 192.168.0.1 on the 192.168.0 network. You want to set a static route through the router
192.168.0.35 to reach the 10.0.35.0 network (netmask 255.255.255.0).
Using the 'ip route' syntax, the entry in route-eth0 might read
10.0.35.0/24 via 192.168.0.35
or
ADDRESS0=10.0.35.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.0.35
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 10:42 AM
03-19-2007 10:42 AM
Re: linux dual nic interfaces configuration
/etc/sysconfig/network-scripts/route-eth1
ADDRESS1=10.40.191.0
NETMASK1=255.255.255.224
GATEWAY1=10.40.191.65
------------
I am assuming that the 0 after ADDRESS is
used by some startup script for eth0 in
your example. So I change it to 1 for eth1.
I rebooted and nothing happened.
I can't explain it any better if I do not
know what it is that I need to explain.
Other than I have a test network 10.40.191
with netmask of 255.255.255.224.
Test interface is 10.40.191.51
Router one hop away is 10.40.191.33
I tried also manually:
route add -net 10.40.191.0 netmask 255.255.255.224 gw 10.40.191.33 metric
1 dev eth1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 08:11 PM
03-19-2007 08:11 PM
Re: linux dual nic interfaces configuration
used by some startup script for eth0 in
your example.
No, it's just the number of the route definition. The first extra route in any route-eth* file must be ADDRESS0/NETMASK0/GATEWAY0, if there is a second one it must be ADDRESS1/NETMASK1/GATEWAY1, etc.
The interface is already specified by the filename, so there is no need to repeat that.
The scripts that add the actual routes will first check whether ADDRESS0 is defined or not. If it is, that route is added and the number is incremented by one. This will be repeated until there are no more route definitions.
If you don't use number 0, the loop will exit immediately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 03:53 AM
03-20-2007 03:53 AM
Re: linux dual nic interfaces configuration
to add, manually, the network route to the
other vlan network 10.40.191.64. I just don't
understand how to put this in a file for
bootup.
route add -net 10.40.191.64 netmask 255.255.255.224 gw 10.40.191.33 dev eth1
I looked at /etc/init.d/network system
startup file and found these lines below,
but it does not make sense unless I put it
in as:
any "net 10.40.191.64 netmask 255.255.255.224 gw 10.40.191.33 dev eth1"
File /etc/init.d/network
.
.
# Add non interface-specific static-routes.
if [ -f /etc/sysconfig/static-routes ]; then
grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
/sbin/route add -$args
done
fi
.
.
.
It's Linux 2.6.12-2.3.legacy_FC3.