|
怎样通过shell简洁地将WEB网页表单提交写入ifcs-eth0文件?谢谢!
我有一台2个网卡的机器想安装LINUX代理服务器。有以下几个问题请求高手解答!
1 我想让别人通过前台WEB网页修改输入机器的2个网卡IP地址,例如外网卡eth0 192.168.2.254/24; 内网卡 eth1 192.168.1.254/24,后台自动存入ifcs-eth0/ifcs-eth1文件,那么怎样编写shell,简洁地将表单提交写入ifcs-eth0/ifcs-eth1文件?
2 我写了个最简单的iptables shell,以完成 NAT
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o eth0 -j SNAT --to-source 192.168.2.254
这个shell怎样自动读取这两个ifcs-eth0/ifcs-eth1地址变量,插入上面iptables这个语句呢?好像用cat、greap可以做?
先谢谢各位了! |
|