Linux Networking Flashcards
Sudo [command]
Sue - Doo
Admin rights request with following command
su
Same as sudo, S U into root
ifconfig
Bring down or up interfaces?
Will these changes be permanent?
Adjust network Interfaces and view current state
ifconfig eth0 up 10.10.10.1 netmask 255.255.255.0
Up = means online
ifup eth0 and ifdown eth0
To bring up or shut down the eth0 interface
Not permanent. Need to find config to do this which is different depending on the distro
Where can you make permanent changes to the interfaces?
It’s different depending on the distro.
In red hat it’s
/etc/sysconfig/network-scripts
Debian
/etc/network/interfaces
Inside you’ll find a bunch of scripts that run when your system boots up and it turns on network services.
There will be a script for each network interfaces.
Edit these scripts to make them permanent.
Example Bootproto=“static” Ipaddr=“10.10.10.2” Netmask=“255.255.255.0” Gateway=“10.10.10.1” NM_CONTROLLED=“no”
Usually don’t need “ unless there are spaces
If NM_CONTROLLED is on
that stands for Network manager, in red hat this automatically set up these scripts. If we are to
Manage these configurations directly, we need to shut off network manager.
ONBOOT=yes it means the system will auto connect it to the interface on boot
UUID is the universal ID. We don’t need this or Ethernet type since the system will auto figure some of this out, but some things are mandatory for connectivity.
How do you turn off network manager?
On upstart systems run
chkconfig NetworkManager off
Then
service NetworkManager stop
If you were on a system D system run
systemctl disable NetworkManager
Then
systemctl stop NetworkManager.service
Then reboot or just restart network service and it will run the new script.
service network restart