DPOD can be configure with two network interface :
...
- Copy the network interface MAC address as displayed in the "ifconfig" command output after the attribute "ether"
change directory to /etc/sysconfig/network-scripts
Code Block language bash theme RDark cd /etc/sysconfig/network-scripts
duplicate the eth0 (first network interface) network interface configuration file for the new network interface file (eth1)
Code Block language bash theme RDark cp ifcfg-eth0 ifcfg-eth1
Edit the new file (ifcfg-eth1) and alter the following attributes based on the new network interface properties
Code Block language bash theme RDarkDEVICE=eth1 BOOTPROTO=static ONBOOT=yes NM_CONTROLLED=no HWADDR=00:0c:29:14:7a:88 IPADDR=192.168.1.178 NETMASK=255.255.255.0 USERCTL=no DNS1=8.8.8.8 DNS2=8.8.4.4 IFCONFIG_OPTS="txqueuelen 10000"
DEVICE : The network interface device name should be eth1
HWADDR : The network interface MAC address as displayed at section 1.
NETMASK : The network mask based on the new interface properties (the network administrator should supply this information)Restart the network service by entering the following command
Code Block language bash theme RDark service network restart The command output should be : Restarting network (via systemctl): [ OK ]
- Use the command "ifconfig" to make sure the new network interface is up and configured with the correct IP address
If the new IP address is not displayed restart the server. - sdf
...
Edit the file /etc/iproute2/rt_tables and add new routing table entry with id "1" named "rt1"
In order to add new routing entry to the new routing table use the "ip route" command.
This command will add new temporary entry to the routing table.Add a default gateway entry :
Code Block ip route add default via <interface default gateway> dev <interface name> table <routing table name>
Example : For adding the default gateway 192.168.1.1 to interface eth1Code Block language bash theme RDark ip route add default via 192.168.1.1 dev eth1 table rt1
Add a routing entry :
Code Block ip route add <destinamtion ip address or subnet> dev <interface name> table <routing table name>
Example : For adding the route entry to subnet 192.168.1.x to interface eth1Code Block language bash theme RDark ip route add 192.168.1.0/24 dev eth1 table rt1
In order to make these entries permanent edit the file /etc/sysconfig/network-scripts/route-<interface name> and add the following :
Code Block default via <interface default gateway> dev <interface name> table <routing table name> <destinamtion ip address or subnet> dev <interface name> table <routing table name>
For example : Create new permanent routing file for interface eth1 and add the entries used at previous examples :Code Block default via 192.168.1.1 dev eth1 table rt1 192.168.1.0/24 dev eth1 table rt1
Create New Routing Rule
The routing rule instruct the operating system when to use the new routing table.
In order to add new routing rule entry to the new routing table use the "ip rule" command.
This command will add new temporary rule entry .Code Block ip rule add from <source ip address or subnet> table <routing table name> ip rule add to <destination ip address or subnet> table <routing table name>
For example : The routing rule for monitored device 192.168.1.120 are :Code Block ip rule add from 192.168.1.120/32 table rt1 ip rule add to 192.168.1.120/32 table rt1
The specific IP address can be replaced with subnet if subnet rule is appropriate : 192.168.1.0/24In order to make these entries permanent edit the file /etc/sysconfig/network-scripts/rule-<interface name> and add the following
Code Block from <source ip address or subnet> table <routing table name> to <destination ip address or subnet> table <routing table name>
For example : The routing rule for monitored device 192.168.1.120 are :Code Block from 192.168.1.120/32 table rt1 to 192.168.1.120/32 table rt1
dsgf
...