标签:路由器 功能 信息 star res server code name The
把linux配置成路由器
dhcp分配信息包括:
ip地址
子网掩码
网关
dns
dhcp租约时间
dhcp服务安装
yum install dhcp -y
cat > /etc/dhcp/dhcpd.conf <<EOF
subnet 172.16.1.0 netmask 255.255.255.0 {
rango 172.16.1.26 172.16.1.200;
option domain-name-servers 223.5.5.5;
option routers 172.16.1.12;
option broadcast-address 172.16.1.255;
default-local-time 3600;
max-lease-time 7200;
}
EOF
systemctl start dncpd
netstat -lnutp |grep dhcp 67端口
systemctl enable dncpd
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=eth0
DEVICE=eth0
ONBOOT=yes
EOF
systemctl restart network
ip addr
ping 223.5.5.5
标签:路由器 功能 信息 star res server code name The
原文地址:https://www.cnblogs.com/strugger-0316/p/14497305.html