Ticket #2365 (closed defect: fixed)
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: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}");
Note: See
TracTickets for help on using
tickets.


