I've been given a static ip to access the internet. I can set the static ip using NetworkManager. The details of my route and ip addr are as follows:

What I have is:

ip: 192.168.1.63/24
gateway: 192.168.1.1
DNS: 8.8.8.8

I set those for a wifi profile in NetworkManager and I am set.

> ip addr
wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:3e:8e:8e:12:8b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.63/24 brd 192.168.1.255 scope global noprefixroute wlp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::4cc3:48dd:8968:b0e4/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::cb08:73fd:d365:a201/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

> ip route
default via 192.168.1.1 dev wlp3s0 proto static metric 600
192.168.1.0/24 dev wlp3s0 proto kernel scope link src 192.168.1.63 metric 600

I've been trying to set the same ip using netctl but it seems like I can't flush the device properly. This is what I do to connect to the internet using netctl.

systemctl stop NetworkManager
wifimenu

I then select the wifi access point which gives me a random ip. I then try to set my static ip like this

ip addr  flush dev wlp3s0
ip route flush dev wlp3s0

ip addr  add 192.168.1.63/24 broadcast 192.168.1.255 dev wlp3s0
ip route add default via 192.168.1.1 dev wlp3s0 proto static src 192.168.1.63

but now my ip addr and route details are like this:

> ip addr
wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:3e:8e:8e:12:8b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.63/24 brd 192.168.1.255 scope global wlp3s0
       valid_lft forever preferred_lft forever
    inet 192.168.1.208/24 brd 192.168.1.255 scope global secondary noprefixroute wlp3s0
       valid_lft forever preferred_lft forever

> ip route
default via 192.168.1.1 dev wlp3s0 proto dhcp src 192.168.1.208 metric 303
192.168.1.0/24 dev wlp3s0 proto dhcp scope link src 192.168.1.208 metric 303

It looks like I can't get rid of the 192.168.1.208 address. Does anyone know what the problem is?

It says proto dhcp in the ip route output. So I'd guess either wifi-menu, or your profile sets up dhcp mode, so .208 address is regenerated after flush.

Your profile should look something along these lines:

/etc/netctl/wireless-wpa
Description='A simple WPA encrypted wireless connection using 256-bit PSK'
Interface=wlp2s2
Connection=wireless
Security=wpa
IP=static
Address=('10.1.10.2/24')
Gateway='10.1.10.1'
DNS=('10.1.10.1')
ESSID=your_essid
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a
  • OK. How do I fix it? – hamid Aug 12 at 7:02
  • make sure your profile doesn't set dhcp up, and if it doesn't, try connecting without wifi-menu – mikst Aug 12 at 10:47
  • How do I do that? An example would have been nice. wifi-menu creates a netctl profile. Once the file is created, I don't use wifi-menu anymore. – hamid Aug 12 at 10:55
  • Here are some examples wiki.archlinux.org/index.php/Netctl#Example_profiles – mikst Aug 12 at 12:54
  • That is the first thing I tried. Didn't work so I tried to see what's wrong by using the ip command. – hamid Aug 13 at 3:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.