Enviado em 11/02/2018 - 13:16h
Não entendi onde está o erro na sintaxe :
#coding: utf-8
import os
import commands
a = int(input("Endereço Ip:"))
b = int(input("Mascara:"))
c = int(input("Rede:"))
d = int(input("Broadcast:"))
print ("Endereço Ip:")
print (a)
print ("Máscara:")
print (b)
print ("Rede:")
print (c)
print ("Broadcast:")
print (d)
os.system ("rm /etc/network/interfaces")
os.system ("echo auto lo >> /etc/network/interfaces")
os.system ("echo iface lo inet loopback >> /etc/network/interfaces")
os.system ("echo auto enp0s3 >> /etc/network/interfaces")
os.system ("echo allow-hotplug enp0s3 >> /etc/network/interfaces")
os.system ("echo iface enp0s3 inet static >> /etc/network/interfaces")
os.system (str("echo address "+a+" >> /etc/network/interfaces"))
os.system (str("echo netmask "+b+" >> /etc/network/interfaces"))
os.system (str("echo network "+c+" >> /etc/network/interfaces"))
os.system (str("echo broadcast "+d+" >> /etc/network/interfaces"))
os.system ("/etc/init.d/networking restart")
os.system ("ip -4 a")