ip addr vs ifconfig - syntax problem

Need help with your Linux distro? All questions are good - not all answers are -but we try

Moderator: jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

ip addr vs ifconfig - syntax problem

Postby viking60 » 16 Jul 2012, 11:33

I have this lap that often times out on the dhcpd fetching IP- address from the router. I use wpa2 (Wpa supplicant) and netcfg.
So I made this simple script startnet.sh that i put in /usr/bin and run it during boot:

Code: Select all

#! /bin/sh
sleep 1
netcfg cultofthedeadcow_00147FD90B57

exit 0

As you can see it simply waits one second and starts the netcfg profile cultofthedeadcow_00147FD90B57.

Now this works fine or it does not because the lease from the router can be a challenge. very often it fails because it cannot lease from the router.
setting sleep to 15 seconds does not help either in those cases.

So what I do is repetedly run startnet.sh until it finally comes up.

That is not good at all and I have read about people having problems with dhcpd so I decided to fix it berserk style by dictating a fixed IP to the box like this:

Code: Select all

 #! /bin/sh
sleep 1
ifconfig wlan0 10.0.0.8 up
netcfg cultofthedeadcow_00147FD90B57

exit 0


And that seems to have fixed the problem :B But all the fancy gurus over at Arch always say that ifconfig is depreciated and that everyone must use ip like ip addr.
Now that is mostly a display of arrogance because I think it is a lie that ifconfig is depriciated, but in any case ip is supposed to be better.

And I do not want to be out of fashion so I need to know how

Code: Select all

ifconfig wlan0 10.0.0.8 up
looks in ip format.

I get that ifconfig wlan0 up = ip link set wlan0 up
But the big point in my case is to dictate the ip adress (10.0.0.8) in the same prosess and here the commands differ
ifconfig wlan0 10.0.0.8 up works and ip link set wlan0 10.0.0.8 up does not.

So there it is - how is this done with ip?
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

Return to “Help”