** ตั้งค่า IP. ที่การ์ดแลน **
# alias ที่ไฟล์ /etc/rc.conf
ifconfig_rl0="inet 192.168.0.1 netmask 255.255.255.0"
ifconfig_rl0_alias0="inet 192.168.0.2 netmask 255.255.255.255"
เสร็จแล้วใช้คำสั่ง netstart ครับ
#/etc/netstart ; เพื่อ restart network configuration
ถ้าจะ set lan card ใบเดียวให้มี หลาย ๆ ip ให้ทำแบบนี้คับ
# ifconfig rl0 alias 192.168.1.1 netmask 255.255.255.0
# ifconfig
rl0: flags=8843 mtu 1500
inet 202.29.80.130 netmask 0xffffff80 broadcast 202.29.80.255
inet6 fe80::202:44ff:fe14:ba%rl0 prefixlen 64 scopeid 0x1
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:02:44:14:00:ba
media: Ethernet autoselect (100baseTX )
status: active
เพียงแค่นี้ก็จะสามารถใช้ได้ 2 ip คับผม
หรือถ้าต้องการให้ ip ที่เพิ่มเข้าไปใหม่นั้นทำงานทุกครั้งที่มีการ boot เครื่องให้เพิ่มบรรทัดนี้ ในไฟล์ /etc/rc.conf นะคับ
ifconfig_rl0_alias0="192.168.1.1 netmask 255.255.255.0"
สามารถทำได้หลายแบบนะครับ
รู้สึกว่าใน Slackware จะใช้แบบนี้นะครับ
# ifconfig rl0:0 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
# ifconfig rl0:1 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
ถ้า rl0 คือชื่อ lan card ใบที่ 1 กำหนดเป็น ip address ตัวที่ 1
ส่วน :0 และ :1 ก็เป็นหมายเลข ip address ตัวที่ 2 และ 3 ตามลำดับ
ส่วน BSD น่าจะอย่างงี้นะคับ
# ifconfig_rl0="xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
# ifconfig_rl0_alias1="xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
# ifconfig_rl0_alias0="xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
ถ้าทำผ่าน sysinstall ก็ขั้นตอนนี้นะครับ
/stand/sysinstall -> เลือก configure -> เลือก networking -> เลือก interface -> เลือก ชื่อ lancard ที่จะใส่ค่าไอพี -> จะขึ้นหน้าจอถามค่า IPV6 ตอบ NO -> หน้าจอถามว่าจะรับค่า DHCP หรือไม่ ถ้าไม่ตอบ NO -> จากนั้นจะขึ้นหน้าจอใส่ค่า host , domain ,ip gateway , dns , ip การ์ด , subnetmask ก็ใส่ให้ถูกต้องแล้วก็ OK -> จากนั้นจะกลับมาหน้า interface ใหม่ ให้ทำตามเดิมเลือกอีกการ์ดนึงนะครับ
หรือจะสั่งที่ command line เลยก็ได้ เช่น
ifconfig <ชื่อ interface> inet <เลขไอพี> netmask <เลข netmask> up แล้ว enter ตัวอย่างนะครับ ifconfig bge0 inet 203.185.98.99 netmask 255.255.255.248 up แบบนี้อะคับ ต้อง boot ใหม่ด้วย
แล้วลอง ifconfig ดู
เอาแบบ command line เลยครับง่ายดี
# ifconfig rl0 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
# ifconfig rl1 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
# ifconfig rl0 down / up
# ifconfig rl1 down / up
rl0 คือ ชื่อการ์ดแลนใบที่ 1
rl1 คือ ชื่อการ์ดแลนใบที่ 2
http://www.thaibsd.com/webboard/search.php?Category=thaibsd
วันศุกร์ที่ 26 ธันวาคม พ.ศ. 2551
คลังบทความของบล็อก
-
▼
2008
(65)
-
►
สิงหาคม
(57)
- โปรแกรม portsentry
- all-in-one 2 (portsentry+iptables+apt-proxy+squid3...
- ทำเองได้ Centralized log แถมวิวได้ด้วย PHP SYSLOGV...
- เวอร์ชั่นเต็ม: การติดตั้ง Centralized log ตาม พรบ....
- debian: iptables
- สคริปท์ บล็อค keyword โดยใช้ Squid คับ เห็นมีคน ถา...
- compile ipp2p บน debian etch ไม่ผ่าน ช่วยทีครับ
- compile debian lenny support l7
- http://www.opentle.org/th/node/7854
- ลองติดตั้ง dns แบบเปลี่ยนค่าได้
- http://download.grisoft.cz/softw/70/update/
- การติดตั้ง Samba Server
- My sources.list for Debian Lenny/Sid
- NTPDate: เวลานั้นสำคัญไฉน .
- บทความ debian เยอะมากๆ
- set php บน debian
- การเก็บ log
- โครงการเก็บข้อมูลจราจร (Traffic Data) ด้วยซอฟต์แวร...
- Squid + Radius authentication
- ntop โปรแกรม monitor network
- ติดตั้ง Shorewall บน Ubuntu
- ผมจะทำ Server สำหรับให้บาง user สามารถเข้าอินเตอร์...
- คำสั่งเฝ้ามองระบบ Linux
- สงสัยเรื่อง ไฟล์วอล
- IPTABLES เป็น Firewall พื้นฐานของ Linux เกือบทุก D...
- ดูข้อมูลของ CPU
- Ubuntu : iptables rule
- Iptables : SSH Brute force attack
- My Firewall Config:
- debian: iptables
- ICMP iptables
- วิธี set iptables บน linux แบบง่ายๆ
- ปัญหาเรื่อง function บน MySQL 5.x
- NTPDate: เวลานั้นสำคัญไฉน ....
- ตั้งเวลาด้วย at
- การ dump ข้อมูลใน MySQL ให้ถูกต้องตาม Character-se...
- การติดตั้ง shoutcast เป็น video streaming
- ทำเองได้ centralized log แถมวิวได้ด้วย php syslogv...
- backup mysql database ด้วย mysqldump
- Comodo Firewall
- ป้องกันการโจมตีด้วย SSH
-
►
สิงหาคม
(57)