Answer the question
In order to leave comments, you need to log in
How to give the Internet to the lok. network. ubuntu server?
Hello. I am a noob admin. Already asked about the same question, but did not understand anything. Decided to tweak it a bit.
In general, there is a network in hyper-v.
ubuntu server that has internet through router.
And 2 users on Windows who do not have the Internet ...
Actually the question is how to give them the Internet?
that is, so that the network 172.10.1.0/24 has Internet!
What do we have to do?
Maybe you need to connect somehow differently ?!
This is what my virtual network looks like:
> /etc/network/interfaces
iface eth0 inet static
address 172.10.1.10
netmask 255.255.255.0
dns-nameservers 8.8.8.8
auto eth0
iface eth1 inet dhcp
auto eth1
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.10.1.10 netmask 255.255.255.0 broadcast 172.10.1.255
inet6 fe80::215:5dff:feeb:e320 prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:eb:e3:20 txqueuelen 1000 (Ethernet)
RX packets 3966 bytes 442595 (442.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2255 bytes 1943409 (1.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.103 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::215:5dff:feeb:e321 prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:eb:e3:21 txqueuelen 1000 (Ethernet)
RX packets 6236 bytes 2086681 (2.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5665 bytes 782002 (782.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Answer the question
In order to leave comments, you need to log in
sudo iptables --flush
sudo iptables --table nat --flush
sudo iptables --delete-chain
sudo iptables --table nat --delete-chain
sudo iptables -A FORWARD -i eth0 -o eth1 -s 172.10.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
Как дать интернет в лок. сеть. Ubuntu server?Элементарно.
то есть, чтобы у сети 172.10.1.0/24 был интернет!Интернет это глобальная сеть. Она везде и никакого отношения к 172.10.1.0/24 не имеет.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question