debian 下通过shell获取网卡的ip地址和mac地址
- Published in Debian
ip=`ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'`
mac=`ifconfig | grep HWaddr | awk -F" " '{print $5}'`
ip=`ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'`
mac=`ifconfig | grep HWaddr | awk -F" " '{print $5}'`
1:安装apt-get install openvpn iptables
2:配置服务端
cp -R /usr/share/doc/openvpn/examples/easy-rsa /etc/openvpn
cd /etc/openvpn/easy-rsa/2.0
chmod +x vars
source ./vars
./clean-all
./build-ca
这一步,您一直回车就行,不要填密码,如果要求你回答Y还是N,选Y回车
./build-key-server server
./build-key client1
这2步也跟上面一样,一路回车和选择Y回车
./build-dh
3:配置转发vi /etc/rc.local
添加以下语句,您只要替换“208.110.73.134”为您自己的ip就行# add iptables rule for openvpn
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j SNAT --to 208.110.73.134
4:增加服务器端conf文件vi /etc/openvpn/openvpn.conf
增加如下内容dev tun
proto tcp
port 1194
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
user nobody
group nogroup
server 10.8.0.0 255.255.255.0
persist-key
persist-tun
#status openvpn-status.log
#verb 3
client-to-client
push “redirect-gateway def1″
push “dhcp-option DNS 69.197.153.253″
push “dhcp-option DNS 69.30.192.15″
comp-lzo
ok,启动openvpn服务/etc/init.d/openvpn start
nohup /etc/rc.local &
5:客户端安装配置
到 http://openvpn.net/index.php/open-source/downloads.html 下载winodws客户端
安装后,然后从服务器把以下3个文件拷贝到windows安装路径下的config目录
这3个文件分别是/etc/openvpn/easy-rsa/2.0/keys/ca.crt
/etc/openvpn/easy-rsa/2.0/keys/client1.crt
/etc/openvpn/easy-rsa/2.0/keys/client1.key
6:增加客户端配置文件
在config增加一个配置文件,文件名为client.ovpn
内容如下:client
dev tun
proto tcp
# The hostname/IP and port of the server.
# CHANGE THIS TO YOUR VPS IP ADDRESS
remote 208.110.73.134 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client1.crt
key client1.key
comp-lzo
verb 3
File excerpt:/etc/sysctl.conf
net.ipv4.ip_forward=1
Issue the following command to set this variable for the current session:
echo 1 > /proc/sys/net/ipv4/ip_forward
运行 apt-get -f install
/etc/apt/sources.list
deb http://ftp.fr.debian.org/debian/ squeeze main
deb http://ftp.fr.debian.org/debian/ squeeze-updates main
deb http://security.debian.org/ squeeze/updates main
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
If you like to install and update Webmin via APT, edit the /etc/apt/sources.list file on your system and add the lines :
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
You should also fetch and install my GPG key with which the repository is signed, with the commands :
cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
You will now be able to install with the commands :
apt-get update
apt-get install webmin
All dependencies should be resolved automatically.
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm
rpm -Uvh ius-release*.rpm epel-release*.rpm
yum install yum-plugin-replace
yum replace php --replace-with php53u
yum install -y php53u-* --skip-broken
C:\Users\XXXXX\AppData\Roaming\GTS
用2.09打开BIOS,
厂商选:其他;
SLIC:选择你喜欢的;
SLP:选择你喜欢的(可以与SLIC相同也可以不同品牌);
RW空着;
验证:空着;
工具自动选择“模块法”,点执行,OK!
C:\Users\YOUR USER NAME\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets
add
html:not(.disable_user_stylesheet) a:visited {color: red;}
# mount -t ext2 /dev/mtdblock4 /tmp/config
# mount -t ext2 /dev/mtdblock5 /tmp/config
# mount -t ext2 /dev/sdx6 /tmp/config
# vi /tmp/config/autorun.sh
# chmod +x /tmp/config/autorun.sh
# umount /tmp/config