Find the answer to your Linux question:
Results 1 to 4 of 4
Running Debian 4 on a mini-itx board with a gigabit ethernet card in it's only PCI slot. A converted machine from a file server with X added... The onboard LAN ...
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Location
    Midlands, UK
    Posts
    14

    Route Add Default GW

    Running Debian 4 on a mini-itx board with a gigabit ethernet card in it's only PCI slot. A converted machine from a file server with X added...

    The onboard LAN is set to 192.168.0.9 and the gigabit card is set to 192.168.0.8.

    DHCP is in the range of .20 to .40 and static addresses are from .2 to .10

    I figured it was easier to work things out this way, as they're in clear bands and it's not as if I'm short of IPs

    Unfortunately the gigabit card needs the following string in root to get the connection working to the outside. Internally it's fine.

    Code:
    ammo:/# route add default gw 192.168.0.1
    What would be nice, would be the option not to actually do this manually. I've had a look through a few files with the help of the trusty mc but to no avail yet

    It was suggested in here (another section) to either edit /etc/sysconfig/network-scripts or /etc/rc.local and put a line in.

    The latter file, it states in it that the commands are run at user level access while the route command needs root, and I don't have a "sysconfig" directory in /etc/

    Suggestions please

  2. #2
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    hi
    you find the network configuration files in the /etc/network directory

    i think you need a script in /et/network/if-pre-up.d directory.
    Maybe you can add that line to the interfaces file , but im not sure.

  3. #3
    Just Joined!
    Join Date
    Aug 2007
    Location
    Midlands, UK
    Posts
    14
    Quote Originally Posted by iwanabeguru View Post
    hi
    you find the network configuration files in the /etc/network directory
    Yep, I've already tried adding a file in /etc/network/interfaces with no joy

    Quote Originally Posted by iwanabeguru View Post
    i think you need a script in /etc/network/if-pre-up.d directory.
    The only item in the if-pre-up.d directory is a *wireless-tools* file (exactly as named) but I do not use wireless on this machine.

    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    address 127.0.0.1
    netmask 255.0.0.0
    
    # The primary network interface
    #auto ethGig
    #iface ethGig inet dhcp
    
    auto ethGig
    iface ethGig inet static
    	address 192.168.0.8
    	netmask 255.255.255.0
    
    auto ethHun
    iface ethHun inet static
    	address 192.168.0.9
    	netmask 255.255.255.0
    
    route add default gw 192.168.0.1
    ethGig is the PCI 10/100/1000 card and ethHun is the onboard 10/100. Makes life easier for me Especially when I was doing this over ssh and command-line interface rather than GUI.

  4. #4
    Just Joined!
    Join Date
    Aug 2007
    Location
    Midlands, UK
    Posts
    14
    Right. This has now been resolved. The issue was that although I only had one network cable plugged in, in ethGig, both connections were "up".

    I took both down, with ifdown ethHun and ifdown ethGig and the brought ethGig up on it's own and all worked straight away

    I've now modified the /etc/network/interfaces file to mark the ethHun entries with # preceeding. I don't think this will cause a problem now

    Thanks for the help given here

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •