You are not logged in.

#1 2007-04-23 20:16:40

benson2788
Member
Registered: 2007-04-23
Posts: 2

Having trouble getting eth0 up

Hello all

     I love Archlinux, but I'm having a little trouble with a switch from DHCP over to static IP.  I had DHCP, but I wanted to switch over to static so I could get port forwarding working on my router.  Getting it running by hand is offering no difficulty.  It is as simple as three lines.  I run:

ifconfig eth0 down
ifconfig eth0 192.168.1.4 netmask 255.255.255.0 up
route add default gw 192.168.1.1

as root.  That gets it working fine, with full connectivity.  The only problem is getting everything running smoothly after a reboot automatically.  I know that this should be a simple edit in /etc/rc.conf, but whatever I do, it refuses to go up automatically on reboot.  I can run the second 2 commands on reboot and be up no problem, but this should be automatic.  I'm not sure what I'm doing wrong.  I have attached the relevant portion of my rc.conf for anyone willing to find my mistake.  Thank you very much for reading.

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
HOSTNAME="Heracles"
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
eth0="192.168.1.4 netmask 255.255.255.0"
INTERFACES=(lo eth0)
#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
#gateway="default gw 192.168.0.1"
gateway="default gw 192.168.1.1"
ROUTES=(gateway)
#
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network-profiles
#
#NET_PROFILES=(main)

I know that this will show my ineptitude, but I tried adding up at the end of the eth0 config line, but it wouldn't work then either.  I can't find any immediate problem here, especially since it was working fine when the eth0 line was eth0="dhcp".  I also checked it without "'s around the eth0 line, but it threw errors about "netmask command not recognized" so I can guess that isn't the problem.  Thanks for the assistance.

Offline

#2 2007-04-23 20:45:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Having trouble getting eth0 up

The default rc.conf includes a correctly-formatted example of static IP configuration. See if you have a .pacnew version of the file to look at.

Offline

#3 2007-04-23 21:27:59

benson2788
Member
Registered: 2007-04-23
Posts: 2

Re: Having trouble getting eth0 up

Thanks for the reply, found the problem.  I didn't realize that the interface line was appended directly to ifconfig, I assumed it was to ifconfig $interface.

I didn't have a .pacnew, but I was able to grab the file from http://wiki.archlinux.org/index.php/Rc.conf .  Hope this helps anyone else who could use the file.

Offline

Board footer

Powered by FluxBB