浅写一篇 debian 双网卡固定IP配置DHCP实例
2006-10-25 12:25
381 查看
操作系统:linux/debian
网络接入 中国电信 ADSL 固定IP地址
双网卡分别为:eth0(出口) eth1(接交换机)
eth0:公网 220.172.238.241
eth1:192.168.0.1
用IPTABLES 有这样一句
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 220.172.238.241
DHCP 开始
1) apt-get install dhcp
2) 配置 /etc/dhcpd.conf文件内容,如下:
option domain-name "fugue.com";
option domain-name-servers 202.98.192.68;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
# The other subnet that shares this physical network
subnet 192.168.0.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.0.30 192.168.0.254;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
}
3)个人经验,如果是单网卡可直接/etc/init.d/dhcp restart
但如是双网卡就得指定输入接口,我这里因为NAT 过来的都是从 eth1(哈哈,因为 eth1接交换机)来的。
所以这样执行 /usr/sbin/dhcpd eth1
网络接入 中国电信 ADSL 固定IP地址
双网卡分别为:eth0(出口) eth1(接交换机)
eth0:公网 220.172.238.241
eth1:192.168.0.1
用IPTABLES 有这样一句
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 220.172.238.241
DHCP 开始
1) apt-get install dhcp
2) 配置 /etc/dhcpd.conf文件内容,如下:
option domain-name "fugue.com";
option domain-name-servers 202.98.192.68;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
# The other subnet that shares this physical network
subnet 192.168.0.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.0.30 192.168.0.254;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
}
3)个人经验,如果是单网卡可直接/etc/init.d/dhcp restart
但如是双网卡就得指定输入接口,我这里因为NAT 过来的都是从 eth1(哈哈,因为 eth1接交换机)来的。
所以这样执行 /usr/sbin/dhcpd eth1
相关文章推荐
- Ubuntu下固定ip的网卡配置
- udhcpd.conf配置文档参考--修改网卡设备名interface wlan1 以及最后的网卡固定ip就可以
- VMWare的NAT配置( DHCP和固定IP配置)适用于Linux或者Mac
- Debian 下配置固定ip
- VMWare的NAT配置(包括DHCP和固定IP配置)
- RouterOS 软路由配置固定IP上网+DHCP
- dhcp配置固定ip
- DEBIAN配置samba及固定IP地址设置
- 转载:给debian的单网卡配置多IP时的提示信息
- ubuntu网卡配置固定ip
- Windows路由表详解及双网卡路由配置实例
- Linux 4000 单网卡多IP配置
- [转自CHINAUNIX]Debian(Linux)下的无线网卡配置
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- 配置篇 02. 设置网卡 IP 地址 ❀ Windows Server 2016
- Centos 7 固定ip配置
- linux下一个网卡配置多个IP
- log4j2配置固定内容(IP等)
- 在 Debian Linux 上安装配置 ISC DHCP 服务器