Operating System - Linux
1827808 Members
2323 Online
109969 Solutions
New Discussion

Re: Set-up one Ethernet card for two IP gateways

 
Frederick Maulion
Occasional Advisor

Set-up one Ethernet card for two IP gateways

I plan on using an X2000 workstation as a SAMBA file server. The problem is we are presently using two subnets, 192.168.10.x and 192.168.9.x. Is it possible to set-up Linux so that it can be seen by Windows PCs on both subnets at the same time while using only one Ethernet card? By default, it can only be seen by Windows PCs sharing the same gateway. Or do I really need to have two Ethernet cards, each connected to one subnet? Thanks.
3 REPLIES 3
Paulo A G Fessel
Trusted Contributor

Re: Set-up one Ethernet card for two IP gateways

Frederick,

If I'm not mistaken, what you're trying to do is to make a Samba server visible to two distinct networks.

If the two logical networks are sharing the same physical ethernet network (or sharing the same VLAN, it doesn't matter) you can try set up an alias of the ethx interface. If you're using, say, eth0, and it's set up to be 192.168.9.1, you can set up an interface called eth0:1 this way:

ifconfig eth0:1 192.168.10.1 up

You can configure this on linuxconf too.

OTOH, if the networks you're trying to serve are different (or are placed on different VLAN's), so you'll need a second ethernet card or configure 802.1q on your Linux box.

Paulo Fessel
L'employé propose, le boss dispose.
Eugen Cocalea
Respected Contributor

Re: Set-up one Ethernet card for two IP gateways

Hi,

If the two subnets are on the same physical network, you can make an alias on the network card, with an ip from the other network.

ifconfig eth0:1 xxx.xxx.xxx.xxx up

or make a /etc/sysconfig/network-scripts/ifcfg-eth0:1
and configure the virtual interface there. (and then restart the network)

E.
To Live Is To Learn
I_M
Honored Contributor

Re: Set-up one Ethernet card for two IP gateways

Hi

After you assign virtual IP address to a card,
you must put following lines into your smb.conf otherwise, your SAMBA server does not recognise virtual IP.
This configuration must be in grobal section of smb.conf

interfaces = 192.168.10.0/24 192.168.9.0/24

If you have a trouble,
increse log level (in grobal section) to see what is going on.

Good luck