0

I want to set IP address by using python's subprocess module.

I was trying to use it like this:

from subprocess import call
call(["ifconfig", "eth0", "50.7.192.226", "netmask", "255.255.255.248", "broadcast", "50.7.192.231"])

When I run this script in my CentOS server I get this error:

SIOCGIFADDR: Cannot assign requested address
SIOCSIFBROADCAST: Cannot assign requested address
SIOCSIFBRDADDR: Cannot assign requested address

I couldn't figure out where this error came from.

1 Answer 1

0

You have the broadcast of a /23 if the network is 192.168.1.5

You may want to set broadcast of 192.168.1.255

2
  • Er didn't you just have 192.168.x.x address range in your question. I'll come back when you are fully decided on the question! :-)
    – albal
    Jun 30, 2014 at 11:50
  • oh sorry i was modified! pls check it again ..thanks you! Jun 30, 2014 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .