Suppose a computer makes a soft route, has three network cards, connects 3 different network segments, 192.168.1.1/24, 192.168.2.1/24,192.168.3.1/24, where 192.168.1.1/24 the network segment has a DHCP server, So how do you set up the 192.168.2.1/24 and 192.168.3.1/24 to assign IP to the two segments?
First you have to add a superscope in the dhcp.conf file:
Ddns-update-style Interim; ; Specify DHCP-supported DNS dynamic update to interim
Ignore client-updates; Specifies that the client is not allowed to update DNS records.
Shared-network XXXDHCP {; super-acting domain name is XXXDHCP
Option Subnet-mask 255.255.255.0;
Option Domain-name-servers 192.168.1.2,192.168.1.10,192.168.4.1;
Option broadcast-address 192.168.1.255;
Default-lease-time 86400;
Max-lease-time 172800;
}
Subnet 192.168.1.0 netmask 255.255.255.0 {
Range 192.168.1.21 192.168.1.49;
Option routers 192.168.1.1;
Host PC1 {
Hardware Ethernet MAC;
Fixed-address 192.168.1.20;
}
}
Subnet 192.168.2.0 netmask 255.255.255.0 {
Range 192.168.2.21 192.168.2.49;
Option routers 192.168.2.1;
Host PC1 {
Hardware Ethernet MAC;
Fixed-address 192.168.2.20;
}
}
Subnet 192.168.3.0 netmask 255.255.255.0 {
Range 192.168.3.21 192.168.3.49;
Option routers 192.168.3.1;
Host PC1 {
Hardware Ethernet MAC;
Fixed-address 192.168.3.20;
}
}
DHCP client under Linux:/etc/sysconfig/network-scripts/ifcfg-eth0 modifies bootproto= "None" to Bootproto= "DHCP"
If you need to boot the network automatically when the system starts,/etc/sysconfig/networking the Networking=yes.