User Tools

Site Tools


настройка_сети_в_freebsd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
настройка_сети_в_freebsd [2013/05/22 13:50]
127.0.0.1 внешнее изменение
настройка_сети_в_freebsd [2022/12/29 08:31] (current)
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+# ping 8.8.8.8 
 + 
 +# traceroute -n 8.8.8.8
  
 # sockstat -4 # sockstat -4
Line 46: Line 51:
 ==== Статическая настройка параметров ==== ==== Статическая настройка параметров ====
 <​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 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
- 
 # /​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+
 </​code><​code>​ </​code><​code>​
 # cat /​etc/​resolv.conf # cat /​etc/​resolv.conf
настройка_сети_в_freebsd.1369216248.txt.gz · Last modified: 2014/09/03 11:45 (external edit)