Ticket #2365 (closed defect: fixed)

Opened 22 months ago

Last modified 18 months ago

Ifconfig bad usage in ispcp-net-interfaces-mngr causes networking problems

Reported by: aseques Owned by: nuxwin
Priority: critical Milestone: ispCP ω 1.0.7
Component: Frontend (GUI) Version: ispCP ω trunk
Severity: Don't know Keywords:
Cc:

Description

ispcp-net-interfaces-mngr is using CMD_IFCONFIG as the method to add and remove ip address from the interface.
The problem with ifconfig is that it uses classes by default, so when you add the ip 50.123.123.123, in reality it adds 50.123.123.123/8, so you just lost your connection to 16777214 hosts.
There are two different approaches to this, you can change it from:

$rs = sys_command("$main::cfg{'CMD_IFCONFIG'} ${ip_card}:${ip_id} ${ip_number} up");

To:

$rs = sys_command("$main::cfg{'CMD_IFCONFIG'} ${ip_card}:${ip_id} ${ip_number} netmask 255.255.255.255 up");

Or use the non-obsolete command iproute:

ip add ad ${ip_number}/32 dev ${ip_card}:${ip_id}

ifconfig eth0 50.123.123.123

Change History

comment:1 Changed 22 months ago by benedikt

  • Milestone changed from Working to ispCP ω 1.0.6

comment:2 Changed 22 months ago by nuxwin

  • Owner set to nuxwin
  • Status changed from new to assigned

comment:3 Changed 22 months ago by nuxwin

ifconfig will be replaced by ip

comment:4 Changed 20 months ago by simple

some typos in the version above, it should be

line 88f:

push_el(\@main::el, 'virtual_netcard_add()', "ip addr add ${ip_number}/32 dev ${ip_card}");
$rs = sys_command("ip addr add ${ip_number}/32 dev ${ip_card}");

line 119f

push_el(\@main::el, 'virtual_netcard_remove()', "ip addr del ${ip_number}/32 dev ${ip_card}");
$rs = sys_command("ip addr del ${ip_number}/32 dev ${ip_card}");

comment:5 Changed 18 months ago by nuxwin

  • Milestone changed from ispCP ω 1.0.7 to ispCP ω 1.0.8

comment:6 Changed 18 months ago by nuxwin

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone changed from ispCP ω 1.0.8 to ispCP ω 1.0.7

see r3207

Note: Netmask issue should be review. 32 is bad.

Note: See TracTickets for help on using tickets.