咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
route add -host 192.168.1.11 dev eth0 route add -host 192.168.1.12 gw 192.168.1.1
route add -net 192.168.1.11 netmask 255.255.255.0 eth0 route add -net 192.168.1.11 netmask 255.255.255.0 gw 192.168.1.1 route add -net 192.168.1.0/24 eth0 route add -net 192.168.1.0/24 gw 192.168.1.1
route add default gw 192.168.1.1
route del -host 192.168.1.11 dev eth0
route del default gw 192.168.1.1
route add -net 192.168.1.0/24 dev eth0 # 或者 route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
GATEWAY=[网关IP或者网关网卡名称]
any net 192.168.1.0/24 gw 192.168.1.1 # 或者 any net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
1.临时开启
echo "1" > /proc/sys/net/ipv4/ip_forward
2.永久开启
vim /etc/sysctl.conf
修改net.ipv4.ip_forward=1