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 [2012/07/13 11:28]
val
настройка_сети_в_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 44: 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"​
- +
-# Rename interface example +
-#​ifconfig_em0_name=wan0+
  
 ifconfig_em0="​inet 172.16.1.X/​24"​ ifconfig_em0="​inet 172.16.1.X/​24"​
 defaultrouter="​172.16.1.254"​ defaultrouter="​172.16.1.254"​
  
-#DHCP example +### Rename interface ​example ​### 
-#ifconfig_em0="DHCP"+# 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"​
  
-# 802.1q example+### 802.1q example ​###
 # cloned_interfaces="​vlan2 vlan3" # cloned_interfaces="​vlan2 vlan3"
 # ifconfig_vlan2="​inet 172.16.2.X/​24 vlan 2 vlandev em0" # ifconfig_vlan2="​inet 172.16.2.X/​24 vlan 2 vlandev em0"
 # ifconfig_vlan3="​inet 172.16.3.X/​24 vlan 3 vlandev em0" # ifconfig_vlan3="​inet 172.16.3.X/​24 vlan 3 vlandev em0"
 +
 +### UP iface without ip example ###
 +# 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.1342164531.txt.gz · Last modified: 2013/05/22 13:50 (external edit)