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 [2014/09/03 12:42]
val [Статическая настройка параметров]
настройка_сети_в_freebsd [2022/12/29 08:31] (current)
val
Line 5: Line 5:
 ===== Команды для настройки ===== ===== Команды для настройки =====
 <​code>​ <​code>​
- +$ ifconfig
-# hostname hostX.isp.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 45: Line 50:
  
 ==== Статическая настройка параметров ==== ==== Статическая настройка параметров ====
-<​code>​<​code>​+<​code>​
 # cat /​etc/​rc.conf # cat /​etc/​rc.conf
 </​code><​code>​ </​code><​code>​
-hostname="​hostX.isp.un"+hostname="​server.corpX.un"
  
 ifconfig_em0="​inet 172.16.1.X/​24"​ ifconfig_em0="​inet 172.16.1.X/​24"​
Line 54: 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 68: 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 81: 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 hostX.isp.un hostX+
  
-172.16.1.254 proxy+172.16.1.X server.corpX.un server
 </​code><​code>​ </​code><​code>​
 # cat /​etc/​resolv.conf # cat /​etc/​resolv.conf
 </​code><​code>​ </​code><​code>​
-domain  ​isp.un+domain  ​corpX.un
 nameserver ​     172.16.1.254 nameserver ​     172.16.1.254
 </​code>​ </​code>​
настройка_сети_в_freebsd.1409733759.txt.gz · Last modified: 2014/09/03 12:42 by val