This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
настройка_сети_в_freebsd [2013/04/19 17:29] val |
настройка_сети_в_freebsd [2016/09/14 12:33] val |
||
---|---|---|---|
Line 5: | Line 5: | ||
===== Команды для настройки ===== | ===== Команды для настройки ===== | ||
<code> | <code> | ||
- | + | $ ifconfig | |
- | # hostname gate.corpX.un | + | |
# dhclient em0 | # dhclient em0 | ||
Line 12: | Line 11: | ||
# ifconfig em0 inet 172.16.1.X/24 | # ifconfig em0 inet 172.16.1.X/24 | ||
- | # ifconfig em0 inet 10.5.Z.X/24 alias | + | # ifconfig em0 inet 10.N.Z.M/24 alias |
# ifconfig em0 -alias | # ifconfig em0 -alias | ||
Line 21: | Line 20: | ||
# route add 192.168.X/24 172.16.1.X | # route add 192.168.X/24 172.16.1.X | ||
+ | |||
+ | # hostname server.corpX.un | ||
+ | или | ||
+ | # sysctl kern.hostname=server.corpX.un | ||
</code> | </code> | ||
Line 37: | Line 40: | ||
# netstat -I em0 -inb -w 1 | # netstat -I em0 -inb -w 1 | ||
- | # traceroute -n ya.ru | + | # traceroute -n 8.8.8.8 |
# sockstat -4 | # sockstat -4 | ||
Line 46: | Line 49: | ||
==== Статическая настройка параметров ==== | ==== Статическая настройка параметров ==== | ||
<code> | <code> | ||
- | # sysinstall | ||
- | </code><code> | ||
# cat /etc/rc.conf | # cat /etc/rc.conf | ||
</code><code> | </code><code> | ||
- | hostname="gate.corpX.un" | + | hostname="server.corpX.un" |
ifconfig_em0="inet 172.16.1.X/24" | ifconfig_em0="inet 172.16.1.X/24" | ||
Line 56: | Line 57: | ||
### Rename interface example ### | ### Rename interface example ### | ||
- | #ifconfig_em0_name=wan0 | + | # ifconfig_em0_name=wan0 |
### Alias example ### | ### Alias example ### | ||
- | # ifconfig_em0_alias0="inet 172.16.1.100+X/32" | + | # ifconfig_em0_alias0="inet 192.168.1.10/24" |
# ifconfig_em0_alias1="inet 172.16.1.200+X/32" | # ifconfig_em0_alias1="inet 172.16.1.200+X/32" | ||
# ifconfig_em0_alias2="inet 10.5.Z.X/24" | # ifconfig_em0_alias2="inet 10.5.Z.X/24" | ||
Line 72: | Line 73: | ||
</code><code> | </code><code> | ||
# /etc/rc.d/hostname start | # /etc/rc.d/hostname start | ||
- | |||
# /etc/rc.d/netif start | # /etc/rc.d/netif start | ||
- | |||
# /etc/rc.d/routing start | # /etc/rc.d/routing start | ||
+ | |||
+ | или | ||
+ | |||
+ | # service hostname start | ||
+ | # service netif start | ||
+ | # service routing start | ||
</code><code> | </code><code> | ||
# cat /etc/hosts | # cat /etc/hosts | ||
</code><code> | </code><code> | ||
127.0.0.1 localhost localhost.corpX.un | 127.0.0.1 localhost localhost.corpX.un | ||
- | 172.16.1.X gate gate.corpX.un | + | |
- | 172.16.1.X gate.corpX.un. | + | 172.16.1.X server.corpX.un server |
- | 172.16.1.254 nfs | + | |
+ | 172.16.1.254 proxy | ||
</code><code> | </code><code> | ||
# cat /etc/resolv.conf | # cat /etc/resolv.conf |