hi guys,
on my centos 7 machine i was looking for
/etc/sysconfig/network-scripts/ifcfg.eth0 file
but there is only ifcfg-enp2s0
what is enp2s0? thought i had a standard ethernet card
The following file, binds the ethernet MAC address to ETH0 or ETH1 etc.. We need to delete this file so that a new one is automatically created during reboot with the correct MAC address bound to ETH0 Delete this file: /etc/udev/rules.d/70-persistent-net.rules make sure to change the static IP address in the following files /etc/dhcp.d /etc/hosts /etc/sysconfig/network/ifcfg-eth0 /opt/ltsp/i386/etc/ltsp.conf give the system a different host name in: /etc/HOSTNAME Reboot the system
send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0): '\r
expect { -re $prompt { ;# Send individual commands and get user input set timeout -1 # Get partner hostname and put in vipsetup.txt file send -s "hostname > vipsetup.txt\r" expect -re $prompt # Display the network routing info for the user and prompt for # network interface card number send -s "print \"The network routing table for the $ptner server is displayed below:\n\" ; netstat -rn \r" expect -re "\r(.*):\r" send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0): '\r" interact "\r" return ;# Wait for user input from read command send -- "\r" send -s "echo \$n_card >> vipsetup.txt\r" # Obtain subnet mask information for partner based on network # interface card number being used send -s "msk=\$(cat /etc/sysconfig/network-scripts/ifcfg-\$n_card | grep NETMASK)\r" send -s "msk=\$(echo \${msk#NETMASK=})\r" send -s "echo \$msk >> vipsetup.txt\r" } timeout { send_user "Connection to host $hostip timed out." exit 6 } eof { send_user "Connection to host $hostip failed." exit } }
The network routing table for the PRIMARY server is displayed below: Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 10.105.65.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 10.105.65.1 0.0.0.0 UG 0 0 0 eth0 [root@remotehost root]$ [root@remotehost root]$ ber for this server (i.e. eth0): ' < Enter the network interface card number for this server (i.e. eth0): eth0
root@debian-main:/# ifup eth1 RTNETLINK answers: File exists Failed to bring up eth1
auto eth0 allow-hotplug eth0 iface eth0 inet dhcp iface eth1 inet static address 192.168.10.1 netmask 255.255.255.0 gateway 192.168.10.254