# hostname wb.example.com.cn
# hostname wb.example.com.cn |
# ifconfig xl0 inet 192.168.1.64 netmask 255.255.255.0 up |
# ifconfig xl0 192.168.1.64 |
# ifconfig xl0 down |
# ifconfig xl0 192.168.100.100 alias
# ifconfig xl0 delete 192.168.100.100 |
# ifconfig -a
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.1.64 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:90:27:4e:f6:67 media: autoselect supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full -duplex> 10baseT/UTP lp0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500 tun0: flags=8050<POINTOPOINT,RUNNING,MULTICAST> mtu 1500 sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552 ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet 127.0.0.1 netmask 0xff000000 |
# ifconfig tun0 inet 10.10.1.42 10.10.1.29 |
# route add default 192.168.1.254 |
# route add -net 192.168.10.0/24 192.168.1.253
# route add -net 192.168.20.0 192.168.1.253 |
# netstat -r
Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.1.254 UGSc 1 941 xl0 127.0.0.1 127.0.0.1 UH 1 644 lo0 192.168.1 link#1 UC 0 0 xl0 192.168.1.254 0:e0:1e:ce:85:a9 UHLW 2 0 xl0 192.168.1.64 0:90:27:4e:f6:67 UHLW 1 6 lo0 192.168.1.253 link#1 UHLW 2 0 xl0 192.168.10 192.168.1.253 UGSc 0 0 xl0 192.168.20 192.168.1.253 UGSc 0 0 xl0 |
hostname="wb.example.com.cn"
network_interfaces="xl0 ppp0 lo0" ifconfig_xl0="inet 192.168.1.64 netmask 255.255.255.0" ifconfig_ppp0="inet 10.10.1.42 10.10.1.29" ifconfig_lo0="inet 127.0.0.1" defaultrouter=”192.168.1.254” static_routes=”static_route1 static_route2” static_route1=”-net 192.168.10.0/24 192.168.1.253” static_route2=”-net 192.168.20.0/24 192.168.1.253” |
# cat /etc/hosts
127.0.0.1 localhost 192.168.1.64 wb.example.com.cn wb 192.168.1.254 gateway 192.168.1.253 gateway2 192.168.1.252 gateway3 202.102.245.49 www.online.ha.cn |
# cat /etc/resolv.conf
domain example.com.cn nameserver 192.168.1.250 nameserver 192.168.2.210 |
bind
hosts |
# netstat
Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp 0 2 wb.online.ha.cn.telne www.1030 ESTABLISHED tcp 0 0 wb.online.ha.cn.49157 wcarchive.cdrom..20 ESTABLISHED tcp 0 0 wb.online.ha.cn.1139 wcarchive.cdrom..ftp ESTABLISHED tcp 0 0 wb.online.ha.cn.telne www.1029 ESTABLISHED tcp 56 0 wb.online.ha.cn.1138 wcarchive.cdrom..ftp CLOSE_WAIT tcp 0 0 wb.online.ha.cn.telne www.1028 ESTABLISHED tcp 0 0 wb.online.ha.cn.telne www.1027 ESTABLISHED tcp 0 0 wb.online.ha.cn.1101 email.9999 ESTABLISHED Active UNIX domain sockets Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr f458af00 dgram 0 0 0 f4571fc0 0 f458ae40 f458ae40 dgram 0 0 0 f4571fc0 0 f458af40 f458af40 dgram 0 0 0 f4571fc0 0 f458af80 f458af80 dgram 0 0 0 f4571fc0 0 f458afc0 f458afc0 dgram 0 0 0 f4571fc0 0 0 f4571fc0 dgram 0 0 f45705c0 0 f458af00 0 /var/run/log |
$ ping ftp.freebsd.org
PING wcarchive.cdrom.com (209.155.82.18): 56 data bytes 64 bytes from 209.155.82.18: icmp_seq=1 ttl=240 time=520.726 ms 64 bytes from 209.155.82.18: icmp_seq=2 ttl=240 time=773.465 ms ^C |
$ traceroute www.pku.edu.cn
traceroute to sun1000e.pku.edu.cn (162.105.254.12), 30 hops max, 40 byte packets 1 202.102.245.1 (202.102.245.1) 1.078 ms 0.862 ms 0.850 ms 2 202.102.235.165 (202.102.235.165) 157.337 ms 157.957 ms 174.054 ms 3 202.97.26.217 (202.97.26.217) 134.037 ms 57.994 ms 55.602 ms 4 1S7-rtr1-r-1-hbwh.cn.net (202.97.26.165) 274.626 ms 120.154 ms 580.097 ms 5 202.97.10.113 (202.97.10.113) 623.421 ms 888.556 ms 794.748 ms 6 6A05-rtr2-c-1-bjbj.cn.net (202.97.1.189) 411.728 ms 247.819 ms 245.688 ms 7 202.97.9.1 (202.97.9.1) 762.538 ms 945.893 ms 920.904 ms 8 202.97.8.254 (202.97.8.254) 1181.508 ms 1107.783 ms 374.649 ms 9 1F0-rtr1-r-1-bjbj.cn.net (202.97.2.14) 960.674 ms 635.770 ms 700.182 ms 10 202.97.16.190 (202.97.16.190) 391.926 ms 214.433 ms 721.839 ms 11 * 202.112.63.100 (202.112.63.100) 313.066 ms * 12 * * * 13 * * beijing-rgw-lan.cernet.net (202.112.1.66) 434.928 ms 14 * * * 15 * 202.112.5.194 (202.112.5.194) 282.973 ms 340.009 ms 16 sun1000e.pku.edu.cn (202.112.7.12) 827.202 ms * * |
$ nslookup ftp.freebsd.org
Server: ns.hazzptt.net.cn Address: 202.102.224.68 Non-authoritative answer: Name: wcarchive.cdrom.com Address: 209.155.82.18 Aliases: ftp.freebsd.org $ nslookup 209.155.82.18 Server: ns.hazzptt.net.cn Address: 202.102.224.68 Name: wcarchive.cdrom.com Address: 209.155.82.18 |
原文:http://www.jb51.net/os/Unix/1448.html