Linux

How to Resolve RTNETLINK answers: Invalid argument Error adding default gateway

Posted on
RTNETLINK answers: Invalid argument When I restarted the newly configured network interface, it returned error rtnetlink answers: invalid argument like the following: [root@test ~]# service network restart … RTNETLINK answers: Invalid argument Error adding default gateway … Please check the gateway that you just set.[root@test ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2 … GATEWAY=192.168.25.1 If you were sure about […]
Linux

How To Bind Multiple IP Addresses to One Network Interface on Enterprise Linux 7

Posted on
Here are the steps that you can add more IP address into the network card.Copy the configuration file of eth0 as eth0:0[root@test ~]# cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0Modify the configuration[root@test ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0:0…DEVICE=eth0:0…IPADDR=192.168.0.111…Take the network effective.[root@test ~]# systemctl restart networkVerify the result[root@test ~]# ip a s eth02: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen […]
IPTables

How to Open Ports and Survives from Reboots

Posted on
Open Port There’re differences to open port between Enterprise Linux (EL) 6 and 7, although they are IPTABLES operating underneath. EL6 uses iptables to manage chains and rules. And it uses iptables-save to save the result to a target file. EL7 uses firewall-cmd to manage zones, chains and rules. And it saves the current setting […]
Linux

/etc/hosts Does Not Work on Linux or Windows?

Posted on
/etc/hosts or C:WindowsSystem32driversetchosts is a file for resolving the domain name in a local manner. If you set it incorrectly, you will see no effects on resolving domain name. For example, we add a mapping record to the file like this:[root@test ~]# vi /etc/hosts…server01 10.7.132.12[root@test ~]# ping -c 4 server01ping: unknown host server01The above record is […]
Linux

How to Add DNS on Enterprise Linux 6.5

Posted on
Adding a nameserver to a Enterprise Linux 6.5 is similar with changing nameserver:How to Change DNS on Enterprise Linux 6.5Therefore, I will keep this post as simple as possible. You have two ways to change DNSAdd a directive DNS2 directly in the interface configuration file.[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0…DNS1=8.8.8.8DNS2=168.95.1.1DOMAIN=example.com…Set the directive PEERDNS explicitly to no in the interface […]