Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  
n9nu

Assigning host names to eth0 and eth1 & Route info

Recommended Posts

Hello

 

I have what most would consider a pretty basic system and would like to get a few tips on assigning variables to each of the 2 NIC's I have in this Mandriva Box.

 

This box is connected directly to the 'Inet' via a fiber connection and acts as a FQDN http and FTP server for testing purposes and at times an 'on by request' FTP server. My domain name associated with this box is: fsx-planet.info . That NIC is eth1. The 2nd NIC is assigned 192.168.0.2 (local LAN) via NIC 2 (eth0). I want to access the LAN via eth0 to connect to my FreeNAS box and other machines on that subnet (192.168.0.x). The address of 192.168.0.1 is my Smoothwall box which in-turn feeds to my HP Gigabit managed switch. At this time I do NOT have this machine (the FQDN) behind the smoothwall box via port forwarding. I just want to access the LAN via eth0 (192.168.0.2).

 

My understanding is that I can have only 1 (one) gateway assigned to my box. Right now that gateway is setup to access the INET via my WISP. Now....I have been assigning the eth0 NIC the address of 192.168.0.2 as stated above WITH the gateway field filled in with 192.168.0.1 (the smoothwall box). This I understand is NOT the right way to do it...as I am getting substantial LAG because I have both NIC's assigned separate gateways. I was told I need to assign a 'static route' from the LAN NIC (eth0) to the smoothwall box address so I can properly access the LAN. I do not know where to enter the appropriate information (the route) within the /etc/xxx scripts.

 

My problem or question at this point is: How is the traffic I want to tx/rx via the LAN side able to 'know' to use the correct (eth0) LAN NIC ?? This is were I was told I needed to assign a 'route' to point to the 192.168.0.1 smoothwall box.

 

I have the host 'fsx-planet.info' assigned to the INET NIC (eth1) and the host 'internal.fsx-planet.info' assigned to the LAN NIC (eth0). Both entries get overwritten with 127.0.0.1 each time I reboot. I would like to 'statically' assign those host names to each of the NIC's in a way that they don't get over-written by 'drakhost' which is the Mandriva utility that automatically assigns that info upon start-up.

 

Can I edit say..../etc/sysconfig/network-scripts/ifcfg-eth0 and eth1 to include host info so it 'sticks' each time.

 

I just received an email suggesting I try using 'iptoute2' to allow for multiple gateways on one machine. It seems this is possible, but will wait for more input

 

Tim

 

 

Yeah...I probably made it confusing with all that ;)

Edited by n9nu

Share this post


Link to post
Share on other sites

You don't need multiple gateways.

 

If all your internal machines, freenas etc are all on the same network 192.168.0.x, then you just have the gateway on your machine set to the internet as it was originally. The machine will know that all machines from subnet 192.168.0.x are via eth0 and so it will be able to connect. If it cannot, then you either have a firewall on the other machines, or a problem with that link.

 

The only reason why you would need another route is if you had multiple ethernet segments on your internal LAN. For example, the machine has 192.168.0.x, and your other servers somewhere else have 192.168.10.x for example. Then you would not create a default route via eth0, because you can't really have two, but you would do this:

 

route add -net 192.168.10.0/24 gw 192.168.0.x

 

where the gateway 192.168.0.x is either a router on your LAN that your main server can see, or machine that is acting as a router between the two segments. There are some other complicated ways for routing, but you don't even need the one I've listed as an example here.

 

So, remove the additional default route you have added, and leave it pointing to the internet, access will work on the internal LAN, and if not, then you have a problem elsewhere because all your LAN machines are in the same subnet, and so don't need a default route because they are all connected to the same switch.

Share this post


Link to post
Share on other sites

If you want to handle multiple hostnames on the same machine, then the most convenient way is creating virtual network interfaces. Each virtual NIC can handle one hostname.

Sorry to say that I can't give any solid tip for Mandriva- I am comfortable with it only using Debian, CentOS and ArchLinux.

Share this post


Link to post
Share on other sites

Yep Ian is correct ;) (except for one little thing)

 

if you had another network on your lan you would not route via a gateway but via device.

 

ip route add 192.168.10.0/24 via eth1

*Note: not sure how to do this with route command .. haven't used route for years :D

 

which is why it "just works" out of the box.

 

The linux kernel loads the ethernet interface with a network attached to it, and sends a route via device command when the interface comes up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×