Has anyone had any experience with a dual-homed machine? One NIC gets its info from a DHCP server, the other one has a static IP address. The DHCP-assigned NIC is the main interface for the internet, etc. The static is only used for a few internal networks. Can they both have a default gateway? If so, how is that setup?
On Thursday 12 May 2005 01:05, Steven R. Sharp wrote:
Has anyone had any experience with a dual-homed machine? One NIC gets its info from a DHCP server, the other one has a static IP address. The DHCP-assigned NIC is the main interface for the internet, etc. The static is only used for a few internal networks. Can they both have a default gateway? If so, how is that setup?
A NIC doesn't have a gateway, a system does. The default gateway is where all packets get sent that the system doesn't have a specific rule for. However, all routing rules can have a gateway, just not a default gateway. You can say for example "all packets to network 192.168.100.0/255.255.255.0 should be sent on device eth2 and go through gateway 192,168.10.5". It would be something like route add -net 192.168.100.0 netmask 255.255.255.0 gw 192.168.10.5 dev eth2 The device is usually not needed, since for this rule to work, you need to have another routing rule telling the system how to get to 192.168.10.5, and the device is set in that rule If you have multiple internal networks going through gateways, you may need to add a few of these rules. See "man routes" for a description of how to make it stick across reboots. If you only have one internal network, yast will set everything up for you nicely
Or even easier. Add it to /etc/sysconfig/network/routes
An example with common network interfaces and some static routes:
# Destination Dummy/Gateway Netmask Device
#
127.0.0.0 0.0.0.0 255.255.255.0 lo
204.127.235.0 0.0.0.0 255.255.255.0 eth0
default 204.127.235.41 0.0.0.0 eth0
207.68.156.51 207.68.145.45 255.255.255.255 eth1
192.168.0.0 207.68.156.51 255.255.0.0 eth1
Brad Dameron
SeaTab Software
www.seatab.com
----- Original Message -----
From: "Anders Johansson"
On Thursday 12 May 2005 01:05, Steven R. Sharp wrote:
Has anyone had any experience with a dual-homed machine? One NIC gets its info from a DHCP server, the other one has a static IP address. The DHCP-assigned NIC is the main interface for the internet, etc. The static is only used for a few internal networks. Can they both have a default gateway? If so, how is that setup?
A NIC doesn't have a gateway, a system does. The default gateway is where all packets get sent that the system doesn't have a specific rule for.
However, all routing rules can have a gateway, just not a default gateway. You can say for example "all packets to network 192.168.100.0/255.255.255.0 should be sent on device eth2 and go through gateway 192,168.10.5". It would be something like
route add -net 192.168.100.0 netmask 255.255.255.0 gw 192.168.10.5 dev eth2
The device is usually not needed, since for this rule to work, you need to have another routing rule telling the system how to get to 192.168.10.5, and the device is set in that rule
If you have multiple internal networks going through gateways, you may need to add a few of these rules. See "man routes" for a description of how to make it stick across reboots. If you only have one internal network, yast will set everything up for you nicely
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Wednesday 11 May 2005 10:01 pm, Brad Dameron wrote:
Or even easier. Add it to /etc/sysconfig/network/routes
An example with common network interfaces and some static routes:
# Destination Dummy/Gateway Netmask Device # 127.0.0.0 0.0.0.0 255.255.255.0 lo 204.127.235.0 0.0.0.0 255.255.255.0 eth0 default 204.127.235.41 0.0.0.0 eth0 207.68.156.51 207.68.145.45 255.255.255.255 eth1 192.168.0.0 207.68.156.51 255.255.0.0 eth1
Any time you find it necessary to manually add routes on a network this simple you are almost certainly doing something wrong. SuSE (and every other distro I've used) manage routes just fine using the normal setup tools. If yours didn't is because you messed up in Yast while installing. My general advice is go back and do it right in Yast. -- _____________________________________ John Andersen
Steven R. Sharp wrote:
Has anyone had any experience with a dual-homed machine? One NIC gets its info from a DHCP server, the other one has a static IP address. The DHCP-assigned NIC is the main interface for the internet, etc. The static is only used for a few internal networks. Can they both have a default gateway? If so, how is that setup?
There is only one default gateway for the computer, no matter how many NICs.
participants (5)
-
Anders Johansson
-
Brad Dameron
-
James Knott
-
John Andersen
-
Steven R. Sharp