You are not logged in.

#1 2009-12-24 16:13:51

Atreides
Member
Registered: 2009-11-24
Posts: 60

Need help setting static IP

I thought this would be easy to figure out in Arch after I figured it out on my router, but of course (having never done this before) things are not so simple. I'll try and post as much information as possible, as I can't seem to get the static ip section from the beginners guide on the wiki to work for me.

Router is WRT54G w/ DD-WRT firmware

and heres my networking section as it stands right now (reconfigured it for dhcp to get online to post this)

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
# 
HOSTNAME="arch"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
# 
# 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
#
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
#eth0="eth0 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
wlan0="dhcp"
wlan_wlan0="wlan0 essid home" # Unencrypted
INTERFACES=(eth0 wlan0)

# 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 0.0.0.0"
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.d
#
# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng network netfs crond hal fam alsa slim cups)
# This now requires the netcfg package
#
#NETWORKS=(main)

I set the router to assign a static ip (192.168.1.72) to my laptops mac address, I can't set the router to solely use static ip as there are other people on it who use dhcp. I don't know much about networking, so let me know what other information I'd need to post from my router in order to get it to properly assign a static ip to my laptops mac, and have Arch auto start into that.

Offline

#2 2009-12-24 16:22:34

pyokagan
Member
From: Singapore
Registered: 2009-09-01
Posts: 9

Re: Need help setting static IP

Other than setting the static IP, you also need to
1. Set the gateway. The gateway address is usually the IP address of the router. (The one used to access the web management interface for most routers) For example, my router's IP is 192.168.1.1 So I would modify the line to:

gateway="default gw 192.168.1.1"

2. Set the DNS Servers' addresses. These are found in /etc/resolv.conf . DHCP writes the DNS Servers to that file, so it should already contain the DNS Servers.

Offline

#3 2009-12-24 16:38:29

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Need help setting static IP

Reading this  might also help.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2009-12-24 19:13:10

Atreides
Member
Registered: 2009-11-24
Posts: 60

Re: Need help setting static IP

Well, I think Ive made some sort of progress neutral

Networking looks like this now.

#Static IP example
eth0="eth0 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.1.255"
wlan0="wlan0 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.1.255"
wlan_wlan0="wlan0 essid home" # Unencrypted
INTERFACES=(eth0 wlan0)

# 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.1.1"
ROUTES=(gateway)

And resolv.conf looks like such

# Generated by dhcpcd from wlan0
# /etc/resolv.conf.head can replace this line
domain hsd1.nh.comcast.net
nameserver 192.168.1.1
# /etc/resolv.conf.tail can replace this line

Starting up like that Arch doesn't get hung up on "Network", or display any messages besides "done". Then going into xfce the little taskbar icon says I have a connection to "home", but at only 1mb/s; I can't connect to anything anyways. What else is missing?

Offline

#5 2009-12-24 19:53:07

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Need help setting static IP

Are you connecting from eth0 and wlan0 at the same time with the same ip to the same router ?!


English is not my native language .

Offline

#6 2009-12-24 20:12:09

Atreides
Member
Registered: 2009-11-24
Posts: 60

Re: Need help setting static IP

Nezmer wrote:

Are you connecting from eth0 and wlan0 at the same time with the same ip to the same router ?!

I may be :\

I really only need wifi.

Offline

#7 2009-12-24 21:33:39

JuseBox
Member
Registered: 2009-11-27
Posts: 260

Re: Need help setting static IP

If you have dhcpcd installed you need to remove it then restart the network

sudo pacman -R dhcpcd && sudo /etc/rc.d/network restart

Last edited by JuseBox (2009-12-24 21:34:08)


Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD

Offline

#8 2009-12-24 22:29:17

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Need help setting static IP

JuseBox wrote:

If you have dhcpcd installed you need to remove it then restart the network

sudo pacman -R dhcpcd && sudo /etc/rc.d/network restart

No reason at all to uninstall dhcpcd....


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#9 2009-12-25 02:17:46

JuseBox
Member
Registered: 2009-11-27
Posts: 260

Re: Need help setting static IP

Mr.Elendig wrote:
JuseBox wrote:

If you have dhcpcd installed you need to remove it then restart the network

sudo pacman -R dhcpcd && sudo /etc/rc.d/network restart

No reason at all to uninstall dhcpcd....

no reason you need it either if you going static


Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD

Offline

#10 2009-12-25 07:11:48

area
Member
Registered: 2008-09-18
Posts: 43

Re: Need help setting static IP

Change one of the IPs to something different. Setting both interfaces to the same address will cause problems.

Another note: you probably dont need to change any settings on your router... just set the ip/dns/gateway on your machine and the router will realize that your using a static ip and play nice. If you do this choose and ip outside of your dhcp pool (the group of addresses that the dhcp server on your router pulls from) to avoid issues.

Offline

#11 2009-12-25 07:21:09

area
Member
Registered: 2008-09-18
Posts: 43

Re: Need help setting static IP

And who told you to add this line/what does it do?

Atreides wrote:
wlan_wlan0="wlan0 essid home" # Unencrypted

Offline

#12 2009-12-25 19:00:42

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: Need help setting static IP

Mr.Elendig wrote:

Reading this  might also help.

that did it for me


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#13 2009-12-31 03:05:01

Atreides
Member
Registered: 2009-11-24
Posts: 60

Re: Need help setting static IP

Still trying to figure this out :\

This is what I see in rc.conf now

#Static IP example
#eth0="eth0 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.1.255"
wlan0="wlan0 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(wlan0)

# 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.1.1"
ROUTES=(gateway)

I can't uninstall dhcp, I do need to connect to networks which use it.

I really only use wifi, so I assume I can ignore eth0? Why does this still not work then?

Offline

#14 2009-12-31 03:13:26

Oxyd
Member
From: Czech Republic
Registered: 2008-01-17
Posts: 167

Re: Need help setting static IP

Isn't it supposed to be  wlan0="wlan0 inet 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.1.255" ?

If that still doesn't work, show the output of the following on your non-working configuration: ifconfig, netstat -r, ping 192.168.1.1, ping 74.125.87.105, ping google.com.  (74.125.78.105 should be google.com's address.)

Offline

#15 2009-12-31 03:14:39

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Need help setting static IP

I believe the 'inet' is optional.

And as to wlan0 vs eth0, use whatever is the name of your connection.
Wireless connections often show up as ethX anyways.

Offline

#16 2010-01-04 17:41:34

ctpwR
Member
From: Kzoo, Michigan
Registered: 2009-12-11
Posts: 1

Re: Need help setting static IP

make sure your assocsiated to your wireless ap cool

I just set up a static connection for my desktop and thought it would be more troublesome than it actually was.
This is just a thought but most routers will define a range of ip that will be used in dhcp leasing, ex mine takes 192.168.1.100 through 192.168.1.150.  I was troubled by what changes i'd have to make in my routers webinterface menu to allow static ip addressing, but it turns out when the dhcp server is running on it, it also accepts ip connections that are not in the dhcp lease range.  I didnt even have to change a darn thing! just make sure the ip your defining in your rc.conf is not within your routers lease range. 

sorry if that isnt applicable for solving your problem, just something i learned about  my router so YMMV.

Anyways as an above poster already mentioned, a little more troubleshooting info would be nice.  ifconfig wlan0 recognize your address bcast and mask defined in your rc.conf?  can you ping your router? can you ping another machine on your network?  my fallback is always to just try to ping google.

Best of luck

Offline

#17 2010-01-05 01:34:55

Atreides
Member
Registered: 2009-11-24
Posts: 60

Re: Need help setting static IP

Heh, this may be my longest running newbie thread yet roll

I'll try and post as much as I can with relation to troubleshooting (although I don't know what much of it means), then its off to make another topic as I seem have accidentally messed something else up.

With the aforementioned rc.conf networking bit I receive the following outputs. 

From ifconfig:

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:64 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4300 (4.1 Kb)  TX bytes:4300 (4.1 Kb)

wlan0     Link encap:Ethernet  HWaddr 00:13:02:31:05:8C  
          inet addr:192.168.1.72  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

netstat -r:

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     *               255.255.255.0   U         0 0          0 wlan0
default         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0

I cannot ping google or any other website, but when I try to ping my own router I receive the following error.

From 192.168.1.72 icmp_seq=3 Destination Host Unreachable

I'm pretty sure I've screwed something up. Thanks again for all the help, you guys are awesome :3

Offline

#18 2010-01-06 00:29:18

siot
Member
Registered: 2009-11-10
Posts: 27

Re: Need help setting static IP

Can you show the result of

$ iwconfig

My conf with your data:

/etc/rc.conf

wlan_wlan0="wlan0 essid home" # I connect to the lan before assing an ip
wlan0="wlan0 192.168.1.72"

INTERFACES=(wlan0)

/etc/resolv.conf

nameserver 192.168.1.1 # your gateway acts as dns server?
nameserver 208.67.222.222 # can try opendns server for example

If you start your network "/etc/rc.d/network start" and can't naviagate because you aren't on the lan (iwconfig) or you haven't ip configured (ifconfig) its possible that your scripts needs more timeout.
Edit /etc/rc.d/network , search de function wi_up() and change the variable value "WIRELESS_TIMEOUT=5" to "WIRELESS_TIMEOUT=10" for example (you can try with different values, this value represent the number of seconds.)

Good luck!

Offline

Board footer

Powered by FluxBB