2013年8月31日 星期六

linux-lan

/etc/sysconfig/network-scripts
ifdown ifcfg-eth0
ifup
ifconfig
szexzdz



/etc/sysconfig/network[top] gateway
  • NETWORKING=yes
  • HOSTNAME=host.domainname.com ## set Host Name
  • GATEWAY=20.0.0.254 && SET THE ROUTER'S GATEWAY
/etc/sysctl.conf[top]
net.ipv4.ip_forward=1 && 0 for disable routner, default is 0
net.ipv4.tcp_syncookies = 1 && prevents the Linux machine from sync flood attacks
net.ipv4.icmp_echo_ignore_broadcasts = 1 && prevents attackers make use smurf attacks.
kernel.shmmax = 5000000
/etc/sysconfig/network-scripts/ifcfg-eth0[top]
  • DEVICE=eth0 &&eth0 it must match the file name , when second id, then the eth0, change to eth0:0
  • BOOTPROTO =dhcp ii(dhcp , none, dhcp or static)
  • HWADDR==00:12:34:56:78:90
  • ONBOOT=yes && when linux boot up
  • DHCP_HOSTNAME=servera.domain.com
  • SEARCH=
  • NM_CONTROLLED=
  • IPADDR=192.168.65.31 && iif(dhcp, 192.168.65.31, no this line)
  • NETMASK=255.255.255.0 && iif(dhcp, 255.255.255.0, no this line)
  • GATEWAY=192.168.65.254 && iif(dhcp, 192.168.65.3254, no this line)
Remark : The Second will call ifcfg-eth1

/etc/resolv.conf ## DNS Setting
echo "nameserver 202.14.67.4" >> /etc/resolv.conf




沒有留言:

張貼留言