Various CentOS 7 settings: Difference between revisions

From D3xt3r01.tk
Jump to navigationJump to search
Created page with "===WHAT=== CentOS 7 has a new way of doing stuff... Here's what I got to so far ===HOW=== By default the minimal net install doesn't come with ifconfig so you can use this t..."
 
Line 16: Line 16:
<source lang="bash">
<source lang="bash">
yum remove avahi firewalld NetworkManager
yum remove avahi firewalld NetworkManager
</source>
Also, you might want to disable IPv6
<source lang="bash">
echo "
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
" >> /etc/sysctl.conf
</source>
Disable quiet and rhgb by just deleting the words in /etc/default/grub and then doing
<source lang="bash">
grub2-mkconfig -o /boot/grub2/grub.cfg
</source>
If you want to change the port of the ssh and want to keep selinux:
<source lang="bash">
yum install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 5022
</source>
</source>



Revision as of 21:09, 11 October 2014

WHAT

CentOS 7 has a new way of doing stuff... Here's what I got to so far

HOW

By default the minimal net install doesn't come with ifconfig so you can use this to set up your networking.

 
ip addr list # this will get you a list of devices and settings
ip addr add IP/CIDR dev <dev> # replace dev with your interface name you got from above
ip link set dev <dev> up # same as ifconfig <dev> up .. or you can do ifup <dev> if you set up your /etc/sysconfig/network-scripts/ifcfg-<dev> right
ip route add default via <gateway> # replace gateway with your gateway ip

I don't use/need {avahi,firewalld,NetworkManager} in my minimal setup on a dedicated server.

yum remove avahi firewalld NetworkManager

Also, you might want to disable IPv6

echo "
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
" >> /etc/sysctl.conf

Disable quiet and rhgb by just deleting the words in /etc/default/grub and then doing

grub2-mkconfig -o /boot/grub2/grub.cfg

If you want to change the port of the ssh and want to keep selinux:

yum install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 5022

You can also just disable NetworkManager for one interface by setting this in /etc/sysconfig/network-scripts/ifcfg-<dev>

NM_CONTROLLED="no"

SOURCES

CentOS7 FAQ