You are not logged in.

#1 2013-02-05 21:04:11

fixles
Member
Registered: 2012-09-15
Posts: 101

Static wireless netcfg profile

Hi,

I'm trying to create a netcfg profile with a static ip. The profile connects and I can ping internal IP's but not external. The dhcp one created with wifi-menu works fine and the info appears to be the same. The gateway and DNS are the correct ip addresses.

Heres the config file

CONNECTION='wireless'
DESCRIPTION='A simple WPA encrypted wireless connection using a static IP'
INTERFACE='wlp5s0'
SECURITY='wpa'
ESSID='virginmedia'
KEY='password'
IP='static' # Any other CONNECTION='ethernet' options may be used.
ADDR='192.168.0.23'
GATEWAY='192.168.0.1'
DNS=('192.168.4.100')
# Uncomment this if your ssid is hidden
#HIDDEN=yes

Any ideas why I cant connect to the outside world?

Thanks.

Offline

#2 2013-02-05 22:48:02

hawaiicharles
Member
Registered: 2012-12-21
Posts: 71

Re: Static wireless netcfg profile

The example files are missing a NETMASK entry.  Just add the line
NETMASK=24
right after the ADDR line (it could go anywhere I suppose, but that's the sensible place for it).
I took a guess as to what your NETMASK value should actually be, but I could have guessed wrong.  Adjust accordingly.

Last edited by hawaiicharles (2013-02-05 22:50:29)

Offline

#3 2013-02-05 22:51:03

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 833

Re: Static wireless netcfg profile

I would read over the man page for netcfg profiles: https://www.archlinux.org/netcfg/netcfg-profiles.5.html

Also, you are making your profile too complicated.  You don't need to use every option for a typical connection.  I would try to simplify it to only what you need to make a connection and thus make troubleshooting easier.

Edit: According to the wiki for static ip this is what you need in your profile:

You need:

    Static IP address
    Subnet mask
    Broadcast address
    Gateway's IP address

Simply add your security needs to this and it should work.

Last edited by the sad clown (2013-02-05 22:59:07)


I laugh, yet the joke is on me

Offline

#4 2013-02-05 23:24:22

fixles
Member
Registered: 2012-09-15
Posts: 101

Re: Static wireless netcfg profile

hawaiicharles wrote:

The example files are missing a NETMASK entry.  Just add the line
NETMASK=24
right after the ADDR line (it could go anywhere I suppose, but that's the sensible place for it).
I took a guess as to what your NETMASK value should actually be, but I could have guessed wrong.  Adjust accordingly.

No I dont think that's it. I tried that and it didnt work. DHCP is using /24 I have noticed a difference in the ip route output between static and dhcp. When on dhcp it shows "metric 303" but I cant find out what this is or how to set it?

No DHCP

root@laptop ~ $ ip route
default via 192.168.0.1 dev wlp5s0 
192.168.0.0/24 dev wlp5s0  proto kernel  scope link  src 192.168.0.23 
root@laptop ~ $ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
3: wlp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:26:c7:37:94:d4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.23/24 brd 192.168.0.255 scope global wlp5s0
    inet6 fe80::226:c7ff:fe37:94d4/64 scope link 
       valid_lft forever preferred_lft forever
root@laptop ~ $ 

With DHCP

root@laptop ~ $ ip route
default via 192.168.0.1 dev wlp5s0  metric 303 
192.168.0.0/24 dev wlp5s0  proto kernel  scope link  src 192.168.0.3  metric 303 
root@laptop ~ $ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
3: wlp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:26:c7:37:94:d4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.3/24 brd 192.168.0.255 scope global wlp5s0
    inet6 fe80::226:c7ff:fe37:94d4/64 scope link 
       valid_lft forever preferred_lft forever
root@laptop ~ $ 

Last edited by fixles (2013-02-05 23:24:52)

Offline

#5 2013-02-05 23:26:35

fixles
Member
Registered: 2012-09-15
Posts: 101

Re: Static wireless netcfg profile

the sad clown wrote:

Simply add your security needs to this and it should work.

Thanks but I think the problem is not enough information. I think I need to set metric somehow (See post above),

Offline

#6 2013-02-06 00:12:52

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 833

Re: Static wireless netcfg profile

Is this a router you are connecting to?

Edit: also, does the failed attempt throw up any error messages?

Last edited by the sad clown (2013-02-06 00:40:11)


I laugh, yet the joke is on me

Offline

#7 2013-02-06 00:33:34

graysky
Member
From: The worse toilet in Scotland
Registered: 2008-12-01
Posts: 8,818
Website

Re: Static wireless netcfg profile

Not sure what your problem is... have you tired netctl from the AUR?  It should replace netcfg in not too long.  After installing it, here is the profile template for your needs which is very similar, although not identical to the netcfg example:

% cat /etc/network.d/examples/wireless-wpa-static
Description='A simple WPA encrypted wireless connection using a static IP'
Interface=wlan0
Connection=wireless
Security=wpa
ESSID='MyNetwork'
Key='WirelessKey'
IP=static
Address='192.168.1.23'
Gateway='192.168.1.1'
DNS=('192.168.1.1')
# Uncomment this if your ssid is hidden
#Hidden=yes

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#8 2013-02-06 00:55:32

hawaiicharles
Member
Registered: 2012-12-21
Posts: 71

Re: Static wireless netcfg profile

fixles wrote:
hawaiicharles wrote:

The example files are missing a NETMASK entry.  Just add the line
NETMASK=24
right after the ADDR line (it could go anywhere I suppose, but that's the sensible place for it).
I took a guess as to what your NETMASK value should actually be, but I could have guessed wrong.  Adjust accordingly.

No I dont think that's it. I tried that and it didnt work. DHCP is using /24 I have noticed a difference in the ip route output between static and dhcp. When on dhcp it shows "metric 303" but I cant find out what this is or how to set it?

No DHCP

I'm a little confused about the DNS server you have configured in your static example.  Is that a DNS server that you're running yourself on a different subnet?
If you're not running your own DNS server, then that entry isn't correct.
Can you ping any outside hosts by IP address with your current static setup?

Offline

Board footer

Powered by FluxBB