startips - failing with command not found -CentOS7

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
419
Hi All,

CentOS 7, new install, added two IPs on primary interface ens160

./startips: line 49: 1.2.3.4: command not found
./startips: line 49: 5.6.7.8: command not found


If I drop an IP and then re-add it in the DirectAdmin, it is then showing up on the interface:


# ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b4:34:be brd ff:ff:ff:ff:ff:ff
inet 1.2.3.4/25 brd 1.2.3.127 scope global noprefixroute ens160
valid_lft forever preferred_lft forever
inet 5.6.7.8/25 scope global secondary ens160
valid_lft forever preferred_lft forever
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b4:2f:a9 brd ff:ff:ff:ff:ff:ff
inet 192.168.4.19/24 brd 192.168.4.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever


/usr/local/directadmin/scripts # ifconfig
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 1.2.3.4 netmask 255.255.255.128 broadcast 62.90.141.127
ether 00:50:56:b4:34:be txqueuelen 1000 (Ethernet)
RX packets 650583 bytes 104244279 (99.4 MiB)
RX errors 0 dropped 51 overruns 0 frame 0
TX packets 408034 bytes 36323686 (34.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.19 netmask 255.255.255.0 broadcast 192.168.4.255
ether 00:50:56:b4:2f:a9 txqueuelen 1000 (Ethernet)
RX packets 155224 bytes 9570414 (9.1 MiB)
RX errors 0 dropped 156 overruns 0 frame 0
TX packets 8 bytes 432 (432.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 1329 bytes 137493 (134.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1329 bytes 137493 (134.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

But, after running service network restart and

cd /usr/local/directadmin/scripts
./startips

I get

./startips: line 49: 1.2.3.4: command not found
./startips: line 49: 5.6.7.8: command not found


# ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b4:34:be brd ff:ff:ff:ff:ff:ff
inet 1.2.3.4/25 brd 1.2.3.127 scope global noprefixroute ens160
valid_lft forever preferred_lft forever
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b4:2f:a9 brd ff:ff:ff:ff:ff:ff
inet 192.168.4.19/24 brd 192.168.4.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever


disregard the ens192 -it is a secondary IP for internal communications

Any pointers?

-Sup.
 
Last edited:
/usr/local/directadmin/scripts # service startips restart
Redirecting to /bin/systemctl restart startips.service
/usr/local/directadmin/scripts # ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b4:34:be brd ff:ff:ff:ff:ff:ff
inet 1.2.3.4/25 brd 1.2.3.127 scope global noprefixroute ens160
valid_lft forever preferred_lft forever
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b4:2f:a9 brd ff:ff:ff:ff:ff:ff
inet 192.168.4.19/24 brd 192.168.4.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever

unfortunately it is yielding the same result.
 
unfortunately it is yielding the same result.
At least you don't have the errors anymore, correct? Please to not use the scripts directory for this anymore.
Scripts directory is for creating or rebuilding things, not for restarting things. ;)

Just to be sure, you added the first ip during setup and added the second IP as admin from within the DA panel itself? Correct?
If yes, have a look at:
/usr/local/directadmin/data/ips/ if both ip's are in there and also in:
/usr/local/directadmin/data/ip.list if both ip's are in there.

If yes. you might have discovered an issue and I will just follow the thread to see what might cause this behaviour.
 
/usr/local/directadmin/data/admin/ips # ll
total 8
-rw------- 1 diradmin diradmin 70 May 27 00:34 1.2.3.4
-rw------- 1 diradmin diradmin 76 May 27 17:32 5.6.7.8

/usr/local/directadmin/data/admin # less ip.list
1.2.3.4
5.6.7.8

(ll is alias for ls -la)

so with the exception of not using the scripts directory,. I'm still at the same problem as before. The additional IP is not loading onto the interface.
 
Please let us know the output of:
Code:
/usr/local/directadmin/directadmin c | grep addip=
 
# /usr/local/directadmin/directadmin c | grep addip=
addip=/usr/local/directadmin/scripts/addip
 
how about
Code:
/usr/local/directadmin/directadmin c | grep ethernet_dev=
 
Please note, when adding via the DirectAdmin IP management,. it adds OK.
It just doesn't retain it after reboot/network restart and startips (script or invoking as a service).
The ens160 is the correct name of the device.
 
Back
Top