This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
настройка_сети_в_freebsd [2014/09/09 09:38] val |
настройка_сети_в_freebsd [2022/12/29 08:31] (current) val |
||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== Команды для настройки ===== | ===== Команды для настройки ===== | ||
| <code> | <code> | ||
| - | + | $ ifconfig | |
| - | # hostname server.corpX.un | + | |
| - | или | + | |
| - | # sysctl kern.hostname=server.corpX.un | + | |
| # dhclient em0 | # dhclient em0 | ||
| Line 23: | 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 39: | Line 40: | ||
| # netstat -I em0 -inb -w 1 | # netstat -I em0 -inb -w 1 | ||
| - | # traceroute -n ya.ru | + | # ping 8.8.8.8 |
| + | |||
| + | # traceroute -n 8.8.8.8 | ||
| # sockstat -4 | # sockstat -4 | ||
| Line 47: | Line 50: | ||
| ==== Статическая настройка параметров ==== | ==== Статическая настройка параметров ==== | ||
| - | <code><code> | + | <code> |
| # cat /etc/rc.conf | # cat /etc/rc.conf | ||
| </code><code> | </code><code> | ||
| Line 56: | Line 59: | ||
| ### Rename interface example ### | ### Rename interface example ### | ||
| - | #ifconfig_em0_name=wan0 | + | # ifconfig_em0_name=wan0 |
| + | # ifconfig_wan0="inet 172.16.1.X/24" | ||
| ### 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 70: | Line 74: | ||
| ### UP iface without ip example ### | ### UP iface without ip example ### | ||
| # ifconfig_em0="up" | # ifconfig_em0="up" | ||
| + | |||
| + | ### Bridge example ### | ||
| + | # cloned_interfaces="bridge0" | ||
| + | # ifconfig_bridge0="addm em0 addm em1 up" | ||
| + | # ifconfig_em0="dhcp" | ||
| + | # ifconfig_em1="up" | ||
| </code><code> | </code><code> | ||
| # /etc/rc.d/hostname start | # /etc/rc.d/hostname start | ||
| Line 83: | Line 93: | ||
| # cat /etc/hosts | # cat /etc/hosts | ||
| </code><code> | </code><code> | ||
| - | 127.0.0.1 localhost localhost.isp.un | + | 127.0.0.1 localhost localhost.corpX.un |
| 172.16.1.X server.corpX.un server | 172.16.1.X server.corpX.un server | ||
| - | |||
| - | 172.16.1.254 proxy | ||
| </code><code> | </code><code> | ||
| # cat /etc/resolv.conf | # cat /etc/resolv.conf | ||